EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: devnull on February 27, 2013, 07:19:48 PM



Title: datagrid inline non-ajax combobox editor [solved]
Post by: devnull on February 27, 2013, 07:19:48 PM
I need to add an inline combobox editor into a datagrid, I have googled and searched this forum trying to find the correct syntax but can't seem to crack it.

I know how to add a ajax combobox, but how to add it when the data is hard coded in the object:

Code:
{field:'status',title:'Won/Lost',editor:'combobox',data:[{txt:'Won',val:'won'},{txt:'Lost',val:'lost'}]}

I have tried several variations of this but can't get it to work ??

Thanks


Title: Re: datagrid inline non-ajax combobox editor
Post by: stworthy on February 27, 2013, 11:17:18 PM
Try the code below:
Code:
{field:'status',title:'Won/Lost',
editor:{
type:'combobox',
options:{
valueField:'val',
textField:'txt',
data:[{txt:'Won',val:'won'},{txt:'Lost',val:'lost'}]
}
}
}


Title: Re: datagrid inline non-ajax combobox editor
Post by: devnull on February 28, 2013, 12:08:27 AM
Edit
===

Yes, that works, thanks