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
saveRow Function
23/03/2009
09:33
Avatar
Nathan
Member
Members
Forum Posts: 37
Member Since:
20/03/2009
sp_UserOfflineSmall Offline

Hi,

I've added an extra button on the nav bar which allows managers to approve items added to the grid.  The button adds just fine and the function fires for the button click event but the saveRow call never forward to my url.  I have some debug lines of code in ApproveEntry.php and nothing is routed to the console but the grid reloads afterwards.

Any suggestions ? Perhaps I am using the saveRow method in a wrong context but this seems correct.

Snippet of Code:

.navButtonAdd('#hoursNav',{buttonimg:"./css/artwork/icons/10/checkmark-10.gif",caption:"Approve Item",position:"last",title:"Approve  Item", onClickButton:function(){
                    var gsr = jQuery('#hours').getGridParam('selrow');
                    var data = jQuery('#hours').getRowData(gsr);
                    var id = data.ID;
                    var tid = "PROJECTHOURS"
                    var aurl = "./actions/ApproveEntry.php";
                    jQuery('#hours').saveRow(id,false,aurl,{'table':tid});
                    jQuery('#hours').trigger("reloadGrid");
                }
                });

Nathan

24/03/2009
02:36
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

In order to work this the new added rows should have a attribute editable=1 - i.e the table row should have attribute editable=1

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.

24/03/2009
06:53
Avatar
Nathan
Member
Members
Forum Posts: 37
Member Since:
20/03/2009
sp_UserOfflineSmall Offline

Hi Tony,

How do you set the row to editable ?

Currently I have that the field is editable:

            {name: 'APPROVED', width:75, editable:true, align:'center',editrules:{required:true}, edittype:"checkbox",editoptions:{value:"1:0"},formatter:'checkbox'}

What I would like to do is have this appear in the table(checked or unchecked) but not appear on the form.  Project managers should be able to select items from the grid and jus click approve.

Any suggestions on why my script does not fire ?

.navButtonAdd('#hoursNav',{buttonimg:"./css/artwork/icons/10/checkmark-10.gif",caption:"Approve Item",position:"last",title:"Approve  Item", onClickButton:function(){
                    var gsr = jQuery('#hours').getGridParam('selrow');
                    var data = jQuery('#hours').getRowData(gsr);
                    var id = data.ID;
                    var tid = "PROJECTHOURS"
                    var aurl = "./actions/ApproveEntry.php";
                    jQuery('#hours').saveRow(id,editurl=aurl,extraparam={'table':tid,'approved':1});
                    jQuery('#hours').trigger("reloadGrid");
                }
                });

Thanks,

Nathan

26/03/2009
03:00
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I suggest in this case to use own ajax something like this:

onClickButton:function(){
                    var gsr = jQuery('#hours').getGridParam('selrow');
                    var data = jQuery('#hours').getRowData(gsr);
                    var id = data.ID;
                    var tid = “PROJECTHOURS”
                    var aurl = “./actions/ApproveEntry.php”;
ajax({

url:aurl,

data:.....

complete : function (){

....
                    jQuery('#hours').trigger(”reloadGrid”);

...

}

});

}

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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