Forum


22:20

17/04/2009

Hello all,
I'm trying to use the grid in an adobe Air application that may run without a web server or an internet connection. So I'm loading the data into the grid from an XML file and using Form Editing. When I submit the Add, Edit or Delete I don't want a server Post just update the grid and I'll handle saving to the XML file myself. To do this I've got URL and EditURL set to ClientArray.
What is happening is that the form comes up and functions ok except when I hit the submit button. The onlickSubmit and beforeSubmit events fire ok and the 'Processing...' label appears but then nothing. It doesn't come back from the Post and refresh the grid.
Here's the code
<table id="list" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pager" class="scroll" style="text-align:center;"></div>
<input type="BUTTON" id="adddata" value="Add password" /><input type="BUTTON" id="bedata" value="Edit Selected" /><input type="BUTTON" id="dedata" value="Delete Selected" />
<script type="text/javascript">
var mystr = readXMLFile();
jQuery("#list").jqGrid({
url:'clientArray',
editurl:'clientArray',
datatype: 'xmlstring',
datastr : mystr,
colNames:['Site','Username', 'Cue'],
colModel :[
{name:'site', index:'site', width:250, align: 'left', editable : true, required:true, sortable : true, editoptions:{size:25}},
{name:'username', index:'username', width:250, align: 'left', required:true, sortable : true,editable:true, editoptions:{size:25}},
{name:'cue', index:'cue', width:250, align: 'left', required:true, sortable : true,editable:true, editoptions:{size:25}},
],
pager: jQuery('#pager'),
rowNum:10,
width:750,
sortname: 'site',
viewrecords: true,
imgpath: 'themes/coffee/images',
caption: 'Password Reminders',
});
$("#dedata").click(function(){
var gr = jQuery("#list").getGridParam('selrow');
//getSelectedRow();
if( gr != null ) jQuery("#list").delGridRow(gr,{reloadAfterSubmit:true, caption:'Delete Password',onclickSubmit:deletingData, afterSubmit:afterDelData,modal:true});
else alert("Please Select Row to delete!");
});
$("#bedata").click(function(){
var gr = jQuery("#list").getGridParam('selrow');
if( gr != null ) jQuery("#list").editGridRow(gr,{reloadAfterSubmit:true,modal:true, bSubmit: 'Save',closeAfterEdit:true});
else alert("Please Select Row");
});
$("#adddata").click(function(){
jQuery("#list").editGridRow("new",{reloadAfterSubmit:true, bSubmit: 'Save', closeAfterAdd:true});
});
function afterDelData(){
alert ("done");
}
function deletingData(){
alert("done");
return true;
}
function editingData(dat){
return true;
}
</script>
Any Idea?
06:34

Moderators
30/10/2007

Hello,
clientArray does not work in form editing instead. You can try to set reloadAfterSubmit:false, but I'm not sure that this will help. I'm currently develop a various type of submiting - serverside, clientArray, custom function in all editing modules.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
16:54

Moderators
30/10/2007

Hello,
You can do it without any cahges into the code.
You will need just to create a dummy empty file on the server and set the editurl to this file and you will have the desired result.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
53 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