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
Need help with conditionally displaying the Add modal dialog in jqgrid
06/03/2013
09:25
Avatar
joy_vik
New Member
Members
Forum Posts: 2
Member Since:
06/03/2013
sp_UserOfflineSmall Offline

Hallo Everyone,

I have a jqgrid, and in the page there are also several other fields, the request is to one filed has to be validated when i click on "Add" button in the jqgrid.

if the validation fails then the add modal dialog should not be displayed.

I wrote the validation function in beforeShowForm event for the "Add" button.

but I can not find any way to stop the add popup dilaog from displaying even after the validation falied.

Below is the partial code with which I have tried

.navGrid("#pager",

...

{closeAfterAdd: true, beforeShowForm: beforeShowFormEventForAdd, jqModal: false, width: 400, afterSubmit: afterSubmitEvent, editData: { Ext_MAC: Ext_MAC} },  //add

...);

function beforeShowFormEventForAdd(formid) {
    // Validate BAN and Zip code field when a femto device is about to be added, femto device depends on existing and correctly formatted Zip and BAN
    if (checkBANAndZipFileds()) { //Add Dialog will appear only if the BAN and Zip fields are in correct format
        beforeShowFormEvent(formid);
        MakeSerialNumberOnAddClick(formid);
    }
    else
        //$(formid).css("display","none !important"); did not work; displayed the whole dialog with all editable columns

        $(formid).hide(); // partially worked; displayed only the title caption and the submit, cancel button, rest of the form was hidden.
}

so, please help me guys with this, i need to completely stop dispalying the add popup dilaog if the validation fails.

Thanks in Advance...

06/03/2013
09:44
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

You can use the beforeInitData event. Returning false does not lunch the form.

Please look here

Regards

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/03/2013
10:26
Avatar
joy_vik
New Member
Members
Forum Posts: 2
Member Since:
06/03/2013
sp_UserOfflineSmall Offline

tony said:

Hello,

You can use the beforeInitData event. Returning false does not lunch the form.

Please look here

Regards


Huge thanks...this is just what i needed, thanks a lot Laugh

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
59 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.com

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information