Forum


11:47

10/02/2010

Hey all,
I've searched the forum with no succes, therefor I'm asking if anyone knows how I'd be able to make sure the following works.
I'd like to be able to save a record when the user uses one of the navigation buttons found at the lower-left bottom of the form edit (default settings). Now the user has to manually press the save button or else he/she will lose any changes that have been made to the record.
Thanks in advance for any help or hints toward the right directions
Edit: I've found some more information at the Wiki, I'll be sure to check this out and reply with my findings.
13:48

10/02/2010

So I've found out I should use 'onclickPgButtons' and found a topic here where someone asks for an example and it seems to work for him (or her). However, I can't get it to work. Is there any place where I could get to see some kind of an example of some sort?
My current code:
...
onclickPgButtons: function(which, formid, rowid) {
jQuery('#sData', formid).trigger('click');
},
...
Is "#sData" a predefined parameter or value? Because in the example I got from the other topic it get's followed by the var 'formid'.
I'm starting to get confused and could use some help here, thanks in advance.
17:50

10/02/2010

22:26

01/09/2010

It's not working for me –
First problem I had is that I added this event to the grid definition, not the modal form definition — once I had that fixed, things went better.
I've inserted an Alert() to tell me if the event is being called, and when I press enter on the next button, the alert message appears and I move to the next record. But there is no hit on my server to do a save.
My code looks like this:
jqModal: false,
editCaption: "Edit a Student's Mark",
top: 0,
left: 50,
width: 600,
height: 400,
onclickPgButtons: function (which, formid, rowid) {
alert(which + " button clicked on " + formid );
$("#sData",formid).trigger("click");
},
reloadAfterSubmit:true,
closeAfterEdit:true
};
The alert message is "next button clicked on [object Object]"
My grid definition is as follows:
url: 'wc.dll?CMProcess~AjaxGet~&Data=Grades&Key=&Same=.F.&sk=30R0TFL6417744&sh=39',
datatype: 'xml',
colNames: ['Student','Mark','Seconds','Comments'],
colModel: [{name:'member', sortable:false, width:150 },
{name:'mark', sortable:false, editable:true, width:35 },
{name:'timetaken', sortable:false, editable:true, width:55 },
{name:'comments', sortable:false, editable:true, edittype:'textarea', editoptions:{rows:'8',cols:'60'}, width:300 }],
height: 'auto',
altRows: true,
altclass: 'ui-priority-secondary',
gridview: true,
rowList:[10,25,50,100,999],
page: 1,
rowNum:999,
loadui: 'block',
viewsortcols: [true,'horizontal',true],
hidegrid: false,
caption: 'Enter Student Marks',
editurl:'wc.dll?CMProcess~AjaxPut~&Data=Grades&sk=30R0TFL6417744&sh=39',
loadError: function(xhr,st,err) {
$("#tblmarksMessage").html("Type: "+st+"; Response: "+ xhr.status + " "+xhr.statusText);
},
ondblClickRow: function(rowid) { $("#tblmarks").editGridRow(rowid,editprm);},
loadComplete: function() {
}
});
$("#tblmarks").navGrid('#tblmarksPager',{
add:false,edit:true, edittext:'Edit',del:false,search:false,refresh:true
},
editprm, // edit
{}, // add
{} // delete
)
Any idea what I am doing wrong?
Tony, can you help?
Thanks,
Reg
00:54

10/08/2009

Hi Reg,
You can try to use
$("#sData", "#"+frmtb+"_2").trigger("click");
instead of $("#sData",formid).trigger("click"); where frmtb is a string "TblGrid_"+gID, where gID is the id of your jqGrid. Because id of your grid is "tblmarks", then you cat try simulate saving with respect of
$("#sData", "#TblGrid_tblmarks_2").trigger("click");
or
$("#sData", "table.EditTable#TblGrid_tblmarks_2").trigger("click");
Best regards
Oleg
Most Users Ever Online: 715
Currently Online:
36 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