Title: [SOLVED] Editing a cell onClick TreeGrid Post by: raghav94 on June 25, 2017, 04:22:30 PM I am trying to get a cell edited on being clicked.
I have tried- $('#test').treegrid({ data : testsuiteArray, idField : "id", treeField : "tsName", fitColumns : true, resizeHandle : "right", checkbox: "true", loadMsg : "Processing, please wait …", // multiSort: "true", order: "asc", // sortName: "tsName", // remoteSort: true, columns:[[ {field:'tsName',title : 'Testsuites',width:"20%",sortable:true}, {field:'exeplatform',title : 'Exec PlatForm',width:"30%",sortable:true, formatter: function(){ return '<select id="cc" class="easyui-combobox" name="dept" style="width:200px" multiple=true;>' + '<option value="aa">aitem1</option>' + '<option>bitem2</option>' + '<option>bitem3</option>' + '<option>ditem4</option>' + '<option>eitem5</option>' + '</select>'; } }, {field:'exetype',title : 'Exe Type',width:"20%",sortable:true}, {field:'runon',title : 'Runon',width:"20%",sortable:true,editor:'text'}, {field:'thread',title : 'Thread',width:"10%",editor:{type:'numberbox'},sortable:true} ]], }); AND THIS onClickCell:function(field,row){ console.clear(); console.log("in"); if (field === 'thread'){ console.log("if"); // in and if get printed on the console field.editor = 'numberbox'; } else{ console.log("null"); field.editor = null; } } Both aren't working. :-[ Title: Re: Editing a cell onClick TreeGrid Post by: jarry on June 26, 2017, 08:02:01 AM You should call 'beginEdit' method to begin editing a row. Please refer to this example https://www.jeasyui.com/demo/main/index.php?plugin=TreeGrid&theme=default&dir=ltr&pitem=Editable%20TreeGrid&sort=
Title: Re: Editing a cell onClick TreeGrid Post by: raghav94 on June 29, 2017, 02:38:36 AM Worked!!
Thanks :) |