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
Creating my own jquery ui dialog on jqGrid
10/08/2012
03:19
Avatar
DaveP
Sunshine Coast, QLD, Australia
Member
Members
Forum Posts: 5
Member Since:
10/08/2012
sp_UserOfflineSmall Offline

I have looked through the forum to find my answer but to no avail.  With jqGrid I want to use a jquery ui form dialog I created to view/add/edit rows to my jqGrid rather than the jqGrid “on the fly” form.  Is this possible, and how do I do it?

11/08/2012
10:43
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

This is a little bit hard to do for now.

You can start if you overwrite the modal functions in grid.common.js

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

13/08/2012
09:48
Avatar
DaveP
Sunshine Coast, QLD, Australia
Member
Members
Forum Posts: 5
Member Since:
10/08/2012
sp_UserOfflineSmall Offline

OK, thanks Smile

14/08/2012
06:48
Avatar
sunanan
Member
Members
Forum Posts: 7
Member Since:
06/01/2011
sp_UserOfflineSmall Offline

I think you can put you code to addfunc or editfunc option.

that can add you custom dialog to jqgrid.

anan.sun

15/08/2012
09:21
Avatar
DaveP
Sunshine Coast, QLD, Australia
Member
Members
Forum Posts: 5
Member Since:
10/08/2012
sp_UserOfflineSmall Offline

Our of courtesy and in case anyone else has the same question in future.  This is how I did it:

  1. I created a jquery ui dialog and called it from a <CustomButtons><trirand:JQGridToolBarButton> custom button on my jqGrid.
  2. The dialog ran a jquery ajax json call to an ASP web service. (adding to database) (I’m using jqGrid for ASP.NET web forms).
  3. After the successful ajax call I refreshed the jqGird using $("selector").trigger("reloadGrid");
  4. Or replace step 3 with eval('var data = {…
    $("selector").jqGrid("addRowData", data, "last");
    (this option prevents the ‘loading’ message).
01/09/2012
05:35
Avatar
neerajbhatt
New Member
Members
Forum Posts: 2
Member Since:
01/09/2012
sp_UserOfflineSmall Offline

I am also stuck in same problem

 I am populating a jqgrid from my server, all the columns of particular table are not shown in grid. For example a user has name,his car name and address, but in grid i am only showing user name and car name. When i add or edit a user i need to add and edit the address too, so i cannot use on the fly form as it will show only name and car name.

I have been using a separate form to update the table and reloading the grid and it worked fine. Now i have a requirement that i can add multiple users from form, so i thought of using a jquery ui form dialoge.

jquery ui form dialoge don't update the underlying jqgrid

in dialoge i am writing

 var gridId = $("#gridId");

 alert(gridId);

 var myData = [{name:"neeraj"}, {carname:"toyota"}];

 $("gridId").jqGrid("addRowData", myData, "last");

alert(gridId.getGridParam('records'));

first alert gives me an [object Object] but second one gives undefined

I am calling dialoge from a normal button not jquery custom button

03/09/2012
02:52
Avatar
DaveP
Sunshine Coast, QLD, Australia
Member
Members
Forum Posts: 5
Member Since:
10/08/2012
sp_UserOfflineSmall Offline

Just as an initial glance and without trying it myself have you tried:

var myData = [{name:"neeraj", carname:"toyota"}];

instead?

03/09/2012
09:58
Avatar
neerajbhatt
New Member
Members
Forum Posts: 2
Member Since:
01/09/2012
sp_UserOfflineSmall Offline

Yes i tried but without luck,  i have to change my approach to make a server call at closing of jquery ui dialoge and will refresh the the grid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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