Forum



09:25

18/02/2013

I actual got a problem with my jqGrid and I couldn't find any similar problem on the net.
Maybe I don't took the write tags for it, sorry tho.
Okay lets start talking about the real problem. I'm using inline editing, and I customized the
buttons a bit. I wanna use "ENTER" and "ESC"-Keys as shortcuts. This works fine. I'm manipulating the data in my grid local and only if the user is pressing a specialised button I'll
save the data in a file. This files are used to fill the grid too. So if the user now is editing any
row in the grid which isn't in my file yet, and he is canceling the editing by pressing
ESC, the complete row of data is getting deleted.
Anyone who can help me out?
Thanks in advice. Regards.
#Edit: Edited a couple times to get a better look of the post. Sry for that.
My grid:
// Table jQuery("#tbl").tableDnD({scrollAmount:0}); jQuery("#tbl").jqGrid({ url:'../path/to/my/script.pl', datatype: "json", postData:{'art':'empfang'}, jsonReader: { repeatitems: false }, colNames:['1','2','3','4','5'], colModel: [ {name:'1',index:'1', width:200, align:"left", sortable:true,editable:true,edittype:"text"},{name:'2',index:'2', width:200, align:"left", sortable:true,editable:true,edittype:"select",editoptions:{value:b}},{name:'3',index:'3', width:200, align:"left", sortable:true,editable:true,edittype:"text"},{name:'4',index:'4', width:220, align:"left", sortable:true,editable:true,edittype:"select",editoptions:{value:""}},{name:'5',index:'5', width:200, align:"left",sortable:true,editable:true,edittype:"select",editoptions:{value:""}}], rowNum:2000, rowTotal: 2000, loadtext: 'Reading data...', height: '100%', width: '100%', hidegrid: false, sortable: true, toppager: true, gridview: true, viewrecords: true, rownumbers: true, loadonce: true, editurl: 'dummy.php', pager: '#tbl_toppager', loadComplete: function(data){ $("#tbl").setColProp('4', { editoptions: { value: data.userdata.4} }); $("#tbl").setColProp('5', { editoptions: { value: data.userdata.directory_listing} }); }, gridComplete: function() { $("#_empty","#tbl").addClass("nodrag nodrop"); jQuery("#tbl").tableDnDUpdate(); }, caption: "Testgrid", ondblClickRow: function(id){ jQuery('#tbl').editRow(id, true); } }); jQuery("#tbl").jqGrid('filterToolbar'); jQuery("#tbl").jqGrid( 'navGrid', '#tbl_toppager', { del: true, add: false, edit: false, refresh: false, search: true }, { }, // edit options { }, // add options { reloadAfterSubmit: false, jqModal: true, closeOnEscape: true }, // del options { jqModal: true, closeOnEscape: true } // search options ); jQuery("#tbl").jqGrid( 'inlineNav', '#tbl_toppager', { editParams: { keys: true }, addParams: { addRowParams: { keys: true } } } ); // Inline Editing jQuery("#tbl_toppager_right").hide(); jQuery("#tbl_toppager_center").hide(); jQuery("#tbl").navSeparatorAdd( "#tbl_toppager_left", { sepclass : "ui-separator", sepcontent:"" } ).jqGrid( 'navButtonAdd', '#tbl_toppager_left', { caption: "", buttonicon: "ui-icon-document", title: "Save data in file", position: "last", onClickButton: function () { $("#write_file").dialog('open'); } } );
Most Users Ever Online: 715
Currently Online:
75 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66