Categories | Question details Back To List | ||||||||
combo per cell hi, i have managed to set each individual cell in a grid to have its own type using the setCellExcellType function. however, how do i set individual combo fields for individual cells. i have seen the documentation that shows how to set the combo boxes on the fly, however my grid isnt the same as this, it is as follows: column1 column2 -------------- ----------- tree item 1 type=ed tree item 2 type=ro tree item 3 type=coro tree item 4 type=ch tree item 5 type=clist tree item 6 type=coro please can you advice me on the best way to assign the clist and the coro's on a grid like this as i am a little confused as to the best way of doing this, thanks note: my grid is not always in that order in terms of the rows and the cell types, it could be in a different order or have different cell types, so i need to know how to dynamically control it thanks Answer posted by Support on Feb 04, 2008 06:42 Please check Setting options for specific cell by javascript http://dhtmlx.com/docs/products/kb/index.shtml?cat=search&q=1759&ssr=yes or through XML http://dhtmlx.com/docs/products/kb/index.shtml?cat=search&q=1079&ssr=yes Answer posted by Richard White on Feb 04, 2008 13:31 hi, thanks for this what about the clist? thanks Answer posted by Support on Feb 05, 2008 03:40 There is no such API for clist, but it can be done directly as var c=grid.cells(i,j); //cell in question c.cell._combo=["one,two,three"]; //list of labels, used in clist Answer posted by Richard White on Feb 05, 2008 06:44 Hi, i have literally copied and pasted the code that you gave me and it doesnt come out exactly right, it shows as: {tick box} one,two,three apply it doesn't break them down into individual elements like this: {tick box} one {tick box} two {tick box} three apply what is wrong with this code? thanks richard Answer posted by Support on Feb 06, 2008 02:13 Sorry, was a my typo, instead of c.cell._combo=["one,two,three"]; next need to be use c.cell._combo=["one","two","three"]; Answer posted by richard white on Feb 06, 2008 06:27 Hi thanks for your reply. just one last question, if i want to populate it directly with the contents of an array, it is still putting it in the format: a,b,c,etc.... this is what i am trying to do: var tempClistNames = new Array(); tempClistNames[0] = "One"; tempClistNames[1] = "Two"; tempClistNames[2] = "Three"; combo.cell._combo=[tempClistNames]; but like i said it is displaying as: one,two,three how can i get this to work? thanks Answer posted by Richard White on Feb 07, 2008 13:39 Hi, i have been waiting patiently for your reply to this question yesterday afternoon and all day today, yet i havent recieved any reply. i really do need an answer thank you Answer posted by richard white on Feb 08, 2008 04:23 Hi, i noticed you have been answering my other questions which i appreciate but not this one. my clients are waiting for this feature and i cannot work out what is wrong with it. if you dont have an answer then just tell me and ill try something else instead!!! let me know either way but please just don't ignore this, and i really would appreciate it as soon as possible. i have been dealing with this issue since Monday and it still isn't resolved and it is now Friday! can i ask why you only seem to answer questions a day or longer after they have been asked? can you not man this knowledge base all day and get back to people the same day? i know if you don't answer this question today then i will be waiting until Monday to get an answer.... Answer posted by Support on Feb 08, 2008 08:13 Sorry, for delay The code must be c.cell._combo=["one","two","three"]; In you case it var tempClistNames = new Array(); tempClistNames[0] = "One"; tempClistNames[1] = "Two"; tempClistNames[2] = "Three"; combo.cell._combo=[tempClistNames]; which is equal to combo.cell._combo=[["one","two","three"]]; You have double-array instead of plain one, the correct code will be combo.cell._combo=tempClistNames; Attachments (1)
Answer posted by richard white on Feb 08, 2008 08:19 im very sorry, i didnt even realise that it was my mistake, i was thinking that it was something different i had to do in your code my apologies once again, thanks very much for getting back to me, its very obvious now you have pointed it out - its now working fine!!!! |