Forum


06:58

10/03/2013

Hi Everybody.
I am very new to jqgrid and am finding it hard to solve the problems I am facing while working with jqgrid. I have put some simple validations in the editrules tag but when I edit a record and on submission of the record, It pops up with a message saying "Data has been changed! Save changes?". This message seems OK but it appears before the editrules validation checks take place. when I click on yes on this message box then the window shows me the editrule errors at the top. I am finding it hard to change the order of this message box to appear only after all the validations are successfull.
Please help .
08:24

Moderators
30/10/2007

Hello,
Do you have a simple code for the above mentioted problem?
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.
06:47

10/03/2013

Hello Tony,
Following is the code for the jqgrid.
var grid = $("#brokerList").jqGrid({
url: '@Url.Action("List", "Home")',
editurl: '@Url.Action("Edit_User", "Home")',
datatype: 'json',
mtype: 'GET',
colNames: ['BrokerId', 'Broker Name'],
colModel: [
{ name: 'BrokerId', index: 'BrokerId', width: 40, align: 'left', key: true, editable: true, editrules: { edithidden: false }, hidedlg: true, hidden: true },
{ name: 'BrokerName', width: 300, align: 'left', editable: true, edittype: 'text',sortable:false, editrules: { edithidden: true, required: true }, hidedlg: true, hidden: false, formoptions: { elmsuffix: ' <span style="color:red;padding-left:5px;">*</span>' } }
]
rowNum: 20,
rowList: [10, 20, 30, 40, 50],
pager: '#brokerListPager'}).navGrid('#brokerListPager',
{
edit: true, add: true, del: true, search: false, refresh: true
},
editBroker);
var editBroker = {
url: '@Url.Action("Edit_Broker", "Home")'
, closeAfterAdd: true
, checkOnSubmit: true
, addCaption: "Edit Broker"
, width: "380"
};
Here when I click on Submit button on the edit window, it asks me "Data has been changed! Save changes?" and once I click on OK only then it says "Broker Name: Field is required". However it should give the error first and should ask to save only when all the error conditions are satisfied.
Most Users Ever Online: 715
Currently Online:
66 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