Title: How to load json data in editor of datagrid column dynamical? Post by: ejzhang on March 25, 2013, 12:44:44 AM datagrid colume define:
Code: { Code: onClickRow:function(rowIndex){ Code: [ Title: Re: How to load json data in editor of datagrid column dynamical? Post by: ejzhang on March 26, 2013, 10:31:38 PM Why it's not work? The combobox is empty.
Title: Re: How to load json data in editor of datagrid column dynamical? Post by: ejzhang on March 29, 2013, 01:19:08 AM I want to reload json data into combobox editor of datagrid column when i click a button each times. thanks very much!
Title: Re: How to load json data in editor of datagrid column dynamical? Post by: stworthy on March 29, 2013, 09:53:12 AM Please refer to this example http://jsfiddle.net/xAnDj/.
Title: Re: How to load json data in editor of datagrid column dynamical? Post by: ejzhang on March 29, 2013, 10:17:38 PM thanks first! but i need reload different data each times, such as fetch from a background script with different argument.
Title: Re: How to load json data in editor of datagrid column dynamical? Post by: stworthy on March 30, 2013, 12:01:21 AM After get the combobox editor object, call 'reload' method to reload its new data.
Code: $(this).datagrid('beginEdit', rowIndex); Title: Re: How to load json data in editor of datagrid column dynamical? Post by: ejzhang on March 30, 2013, 07:01:07 AM I cannot do it correctly, help me please! these are my code snippets as following:
Code: var empData = new Array(); Code: onLoadSuccess:function(data){ Code: $btnSearch.click(function(){ Title: Re: How to load json data in editor of datagrid column dynamical? Post by: stworthy on March 30, 2013, 08:29:55 AM Please try the following code.
Code: onLoadSuccess:function(data){ Title: Re: How to load json data in editor of datagrid column dynamical? Post by: ejzhang on March 30, 2013, 07:50:52 PM I try to test that code, but nothing loaded yet!
Title: Re: How to load json data in editor of datagrid column dynamical? Post by: stworthy on March 30, 2013, 09:11:07 PM Try to call console.log(empData) before loadData for combobox to see if the empData is empty.
Title: Re: How to load json data in editor of datagrid column dynamical? Post by: ejzhang on March 30, 2013, 09:42:58 PM That's ok!
Code: $(this).datagrid('selectRow',0); Title: Re: How to load json data in editor of datagrid column dynamical? Post by: ejzhang on March 30, 2013, 09:51:20 PM some errors:
(http://ww4.sinaimg.cn/large/a7480316jw1e38v4luc61j.jpg) Title: Re: How to load json data in editor of datagrid column dynamical? Post by: stworthy on March 31, 2013, 02:58:37 AM Don't really known why to 'beginEdit' and then 'endEdit' at once in 'onLoadSuccess' event. Please refer to this example http://jsfiddle.net/gEJmG/. When click a row to begin editing, the combobox editor is created and its data is loaded with new 'empData'.
Title: Re: How to load json data in editor of datagrid column dynamical? Post by: ejzhang on March 31, 2013, 05:44:23 AM It's okay! thanks very much stworthy!
|