In the navigator setup when the delete button is clicked only the selected row id is passed to edit url. This id has no correlation to the actual record in the database. How do I get the delete option to post the userid (the primary key) instead of the row id?
Cheers,
Dave
Thanks, I’ll give that a try.
Hi, I tried adding the beforeSubmit: saveRecord() to the options but they seem to fire before the grid loads and don’t fire when a record is saved?
I originally had this:
.navGrid(‘#pager’,{}, {height:280,reloadAfterSubmit:false}, {height:280,reloadAfterSubmit:false}, {reloadAfterSubmit:false}, {});
I then tried this:
.navGrid(‘#pager’,{}, {height:280,reloadAfterSubmit:false,beforeSubmit: saveRecord()}, {height:280,reloadAfterSubmit:false}, {reloadAfterSubmit:false}, {});
The saveRecord function simply ran an alert() and return false. This fired before the grid had loaded. When I clicked on the edit button the form pops up to edit the data. When I submit then the editurl is called but the beforeSubmit function is not?
Have I missed something? Is it possible to call a function at the beforeSubmit stage or is there another way to do it? Do I need to actually add my function body into the beforeSubmit option?
Cheers,
Dave
That’s a good plan. I was thinking along the same lines. I’ll give it a go and let you know how it goes!
Cheers,
Dave
Hi Tony,
Problem solved!! I had repeatItems and it should have been repeatitems – note the capitalised I in items!!
As I suspected nothing wrong with the plugin just my typing!!
Thanks again for a great plugin.
Dave
Have changed my call to this:
$(document).ready(function(){
$(“#list”).jqGrid({
url:’assets/includes/listUsers.cfm’,
datatype: ‘json’,
colNames:,
colModel:[
{name:’memberid’,key:true,index:’memberid asc’, width:55},
{name:’realname’,index:’realname’, width:90},
{name:’uname’,index:’uname’, width:150},
{name:’email’,index:’email’, width:150}],
pager: jQuery(‘#pager’),
rowNum:10,
rowList:[10,20,30],
sortname: ‘memberid’,
sortorder: “asc”,
viewrecords: true,
imgpath: ‘assets/js/jqGrid/themes/basic/images’,
jsonReader: {repeatItems: false}
});
});
But still seeing the error. In grid.base.js (line 570). I am using jquery version 1.2.3 (packed).
I would upload a demo but it is only running locally and also needs a username and password to login to the app. I’ll see if I can build myself a demo outside of the application.
I am pretty sure I am doing something wrong I just can’t figure out what. In Firebug everything is loading all images, js and css files so my paths are all correct.
It’s a great plugin and will become the cornerstone of my application (converting an Access DB application to a MySQL web base app!! Just need to get my head around how it works!
Thanks for your help so far!
Dave
see the following url for the javascript and the html.
http://pastie.org/213658
json below – I have changed the email addresses.
{“page”:”1″,”total”:”15″,”records”:”148″,”rows”:[{“memberid”:”1″,”realname”:”David Phipps”,”uname”:”ps”,”email”:”phipps73@m.com”},{“memberid”:”5″,”realname”:”Chapel Studios Test
User”,”uname”:”test”,”email”:”client@.co.uk”},{“memberid”:”154″,”realname”
:”Mike Bishop”,”uname”:”mop”,”email”:”MBi@rd.org.uk”},{“memberid”:”157″,”realname”
:”Joan Davies”,”uname”:”es@hotmail.com”,”email”:”es@hotmail.com”},{“memberid”:”158″
,”realname”:”Betty Bloomfield”,”uname”:”ld@aol.com”,”email”:”ld@aol.com”},
{“memberid”:”159″,”realname”:”James Martin”,”uname”:”stot@btopenworld.com”,”email”:”stot
@btopenworld.com”},{“memberid”:”160″,”realname”:”Claire Holt”,”uname”:”stash@ukonline.co.uk”,”email”
:”stash@ukonline.co.uk”},{“memberid”:”161″,”realname”:”Sharon Maugham”,”uname”:”po@ash-vale
.org.uk”,”email”:”po@ash.org.uk”},{“memberid”:”162″,”realname”:”Caroline Goodyear”,”uname”
:”cove@virgin.net”,”email”:”cove@virgin.net”},{“memberid”:”163″,”realname”:”Carolyn Ford”
,”uname”:”rd1@btinternet.com”,”email”:”rd1@btinternet.com”}]}
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top