Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Validation Trouble.
10/03/2013
06:58
Avatar
simrat
Member
Members
Forum Posts: 5
Member Since:
10/03/2013
sp_UserOfflineSmall Offline

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 Frown.

12/03/2013
03:41
Avatar
simrat
Member
Members
Forum Posts: 5
Member Since:
10/03/2013
sp_UserOfflineSmall Offline

Hello Friends,

Do you have any solution for the above mentioned problem?

12/03/2013
08:24
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

13/03/2013
06:47
Avatar
simrat
Member
Members
Forum Posts: 5
Member Since:
10/03/2013
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information