If I set a key:true for a column then the post data name is hard coded id not the name of the column.
Moreover if I want to set more than one column as key column then How can I do that?This is required if the table has more than one primary key.
The script is written below
|
1 |
<<span class="start-tag">script</span><span class="attribute-name"> src</span>=<span class="attribute-value">"./../js/min/grid.base-min.js" </span><span class="attribute-name">type</span>=<span class="attribute-value">"text/javascript"</span>></<span class="end-tag">script</span>><<span class="start-tag">script</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text/javascript"</span>><br /> jQuery(document).ready(function(){<br /> jQuery("#unitgrid").jqGrid({<br /> url: './interfaceengine.xmlcreator?interface_id=griddemo&part_id=unitgrid',<br /> datatype: "xml",<br />colNames:[ ' ROLE ID ' ,'ROLE TITLE'], <br />colModel:[<br />{name:'role_id',index:'role_id',width:105,key:false, hidden:true, editable:true,edittype:"text",editoptions: {size:30}},<br />{name:'title',index:'title',width:255,key:true, hidden:false, editable:true,edittype:"text",editoptions: {size:30}},],<br /> rowNum:6,<br /> rowList:[2,6,12,15],<br /> pager: jQuery('#pagered'),<br /> imgpath: './../themes/basic/images',<br /> sortname: 'id',<br /> viewrecords: true,<br /> sortorder:"desc",<br /> caption:"GRID",editurl:"./interfaceengine.DBGridEditServlet?interface_id=griddemo&part_id=unitgrid"<br /> }); <br /> jQuery("#unitgrid").navGrid('#pagered',<br /> {}, //options<br /> {height:280,reloadAfterSubmit:false }, // edit options<br /> {height:280,reloadAfterSubmit:true}, // add options<br /> {reloadAfterSubmit:true}, // del options<br /> { } // search options<br /> );<br />});</<span class="end-tag">script</span>><br /> |
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top