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
postext.js - resetting oper param
08/05/2009
23:26
Avatar
akremedy
California, USA
Member
Members
Forum Posts: 37
Member Since:
16/12/2008
sp_UserOfflineSmall Offline

Hi Tony, or anyone familiar with postext.js,

Can someone point me in the right direction on postext.js?  I've been all around it and can't make it work the way I think it should.  I'm trying to use setPostDataItem to manipulate "oper" on POST.  I'll also be trying to appendPostData for some additional params that I need to pass to PHP.

I know grid.postext.js is loading and the function is executing (by way of alert(), etc), but I never see my POST data modified as per firebug.

Here is a snippet of the grid code showing that I'm executing setPostDataItem on onclickSubmit()

    }).navGrid('#mylinks_grid_nav',
        {},
        {closeAfterEdit:false,
         editCaption:'Edit Link',
         height:150,
         reloadAfterSubmit:true,
         url:'.assets/admin_funcs.php?oper=updlnkx',
         width:450
        },
        {addCaption:'Add Link',
         clearAfterAdd:true,
         closeAfterAdd:false,
         height:150,
         reloadAfterSubmit:true,
         url:'.assets/admin_funcs.php',
         width:450,
         beforeShowForm:function(formid){
             jQuery("#pop").val("addlnk");
             jQuery("#link",formid).val("http://");
         },
         onclickSubmit:function(){
             jQuery("#mylinks_grid_table").setPostDataItem('oper','addlnk');
         },
         afterComplete:function(serverResponse,postdata,formid){
             jQuery("#pop",formid).val("addlnk");
             jQuery("#link",formid).val("http://");
         }
         },

I've tried a variety of other postext methods just to test, but have yet to get any of them working.  I've also tried manupulating POST params that are defined in the colModel (thinking that maybe the non-colModel POST params aren't exposed for manipulation??), but no success there either.

I'd much rather use postext if possible - as it stands, I'm having to add hidden columns in colModel to use in passing "extra" POST data, which I don't think is a very clean way to do things.

Thanks,

Adam

09/05/2009
09:58
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I'm not sure you should use this. As per docs onclickSubmit should return object which then is extended to the post data. Try this (not tested) it should work:

onclickSubmit : function () {

// if you want add to all grid parameters here is a better solution

jQuery(”#mylinks_grid_table”).setGridParam({postData:{oper:'addlink'}});

// but here is the right return

return {oper:'addlink'}

}

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.

09/05/2009
12:59
Avatar
akremedy
California, USA
Member
Members
Forum Posts: 37
Member Since:
16/12/2008
sp_UserOfflineSmall Offline

Thanks Tony!  Was I making this way too complicated, or what??  LOL

Adam

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
84 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