The sale of non-grain in exchange for grain, such as buying and selling cloth in exchange for wheat
According to the most correct opinion of the scholars, this is permissible. There are very many proofs for it. Some of them are general proofs that indicate the permissibility of sale and of credit transactions. It is narrated in the Sahihayn from Aisha al-Siddiqah (may Allah be pleased with her) that “the Prophet ﷺ bought grain on credit from a Jew and pawned his iron armour with him.”
The salam sale also indicates its permissibility. When the Prophet ﷺ came to Madinah, and people used to give advance payment for fruits for a period of one or two years, he ﷺ said:
Whoever gives an advance payment for something, let him give it for a specified measure, a specified weight and a specified period. ?
He ﷺ did not stipulate that the price be paid in cash. This is evidence that giving on credit, in exchange for grain, cloth, animals, wool and the like, by measure and weight, is permissible where the description is well defined and the other conditions are also met (that is, the salam sale is permissible in these things). And Allah knows best.