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

Please check
     Setting options for specific cell  by javascript
        dhtmlx.com/docs/products/kb/inde … 79&ssr=yes

hi, thanks for this

what about the clist?

thanks


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

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

Sorry, was a my typo, instead of
    c.cell._combo=[“one,two,three”];
next need to be use
    c.cell._combo=[“one”,“two”,“three”];

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

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

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…

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;







sample_clist.zip (1.06 KB)

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!!!