On the left is your inventory. If its grey out that means you have ZERO of that items anywhere in your city (local storage or in the trade post) if its highlighted (eg baskets) click on it and you can use the slider or enter the amount you want to transfer from storage to market) the worker will then go get that amount. Same with gold and when the trader arrives, his UI is on the right.
Top few is BUYING, under those is what they are SELLING, again click on the item and use the slider or type the amount and it will transfer those items (if you have enough gold) and there you go u just bought goods.
You can buy and stock, which will keep the goods at the market, or you can buy and transfer and goods go to the storage for use. You can also tell the market to KEEP X amount of an item on hand, so baskets for eg. stock 50 and click the little icon, it will turn green. Now when you sell those 50, or 30 etc the trader will go and collect more to keep 50 on hand.