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
Search Button missing
02/03/2009
17:56
Avatar
kspeakman
Member
Members
Forum Posts: 9
Member Since:
29/01/2009
sp_UserOfflineSmall Offline

I'm using a function as the dataType so that I can integrate with .NET Web Services.

This works fine and displays data, and the paging functions work, but the Search and Refresh buttons are missing from the pager. None of the examples specifically show how to make it display (yet it shows up on the page), so I figured it was shown by default. But it's not there on my grid.

I can't figure out how to make it display. I tried doing:

jQuery("#grid").navGrid("#pager", { search: true });

But that doesn't work (shows a strange dialog and gives a JavaScript error).

Here's the simplified JS of my grid:

    jQuery("#grid").jqGrid({
        datatype: function(postData) {
            MyNameSpace.MyService.GetFileData(postData, function(response){
                $("#grid")[0].addJSONData(response);
            });
        },
        cellEdit: false,
        height: 'auto',
        colNames: ["dl_id","line","col1","col2","col3"],
        colModel: [
            {align:'',hidden:true,index:'dl_id',name:'dl_id',sortable:false,width:0},
            {align:'',hidden:false,index:'line',name:'line',sortable:true,width:52},
            {align:'',hidden:false,index:'col1',name:'col1',sortable:true,width:70},
            {align:'',hidden:false,index:'col2',name:'col2',sortable:true,width:70},
            {align:'',hidden:false,index:'col3',name:'col3',sortable:true,width:70}
        ],
        imgpath: 'jqGrid/themes/sand/images',
        pager: 'pager',
        viewrecords: true,
        rowNum: 10,
        rowList: [10, 20, 30],
        sortname: 'line',
        sortorder: 'asc',
        caption: "Data"
    });

The response object in the code above looks like this:

{ total: "xxx", page: "yyy", records: "zzz", rows : [ {id:"1", cell:["cell11", "cell12", "cell13"]}, {id:"2", cell:["cell21", "cell22", "cell23"]}, ... ] }

03/03/2009
03:50
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Do you have included grid.formedit.js in head section or in the loader?

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.

03/03/2009
10:20
Avatar
kspeakman
Member
Members
Forum Posts: 9
Member Since:
29/01/2009
sp_UserOfflineSmall Offline

Hi Tony,

Thanks for the response.

I do have this line in the jquery.jqGrid.js under modules:

        { include: true, incfile:'grid.formedit.js',minfile: 'min/grid.formedit-min.js' }, // jqGrid Form editing

Is there something more that I need to do?

I recently upgraded to 3.4.2, but the find button didn't show in the older version either. I had other issues to deal with (getting jqGrid and .NET integrated), so I haven't worried about it until now.

I might be willing to settle for adding a custom find button, since I need to be able to search multiple fields anyway. I'll try adding a custom button and see if that works.

Thanks,

Kasey

03/03/2009
15:29
Avatar
kspeakman
Member
Members
Forum Posts: 9
Member Since:
29/01/2009
sp_UserOfflineSmall Offline

I can't get a custom button added either. When I try, a dialog box shows up below the grid that says:

Warning
Please, select row

The dialog box is not draggable, not closeable, but it indicates both (move cursor and close button). There's also a JS error. Here it is from Firebug:

jQuery(a).jqDrag is not a function http://localhost:1598/MyData/j.....mon-min.js Line 6

Stack Trace:
DnRModal("#alertmod", "#alerthd")grid.com...on-min.js (line 6)
searchGrid()()grid.for...it-min.js (line 6)
init()(Object 0=table#gridMasterASSESS.scroll length=1, function(), undefined)jquery-1.3.min.js (line 12)
init()(function(), undefined)jquery-1.3.min.js (line 12)
searchGrid()("#gridPagerASSESS", Object edit=true editicon=row_edit.gif add=true, undefined, undefined, undefined, undefined)grid.for...it-min.js (line 6)
receiveColumnModel(Object)MyDataFile.js (line 127)
onComplete()ScriptRe...=475b88c8 (line 5492)
(?)()()ScriptRe...=475b88c8 (line 2399)
Sys$Net$WebRequest$completed(Object)ScriptRe...=475b88c8 (line 5103)
(?)()()ScriptRe...=475b88c8 (line 4721)
[Break on this error] var showModal=function(a){a.w.show()};va...ace(/</g,"&lt;").replace(/"/g,"&quot;")}

Could this be a timing issue between the grid doing all its initialization tasks and the first data request (since I'm using function datatype instead of json)?

03/03/2009
15:39
Avatar
kspeakman
Member
Members
Forum Posts: 9
Member Since:
29/01/2009
sp_UserOfflineSmall Offline

Using google, I found from a comment on a release post that I needed to include jqDnR.js and jqModal.js. Including those two made the stock button show up (Refresh, Search, etc.), as well as the custom button that I had added.

I didn't realize that DnR and Modal were required for that functionality. I also looked for them in jquery.jqGrid.js, but they were not listed as modules.

I still have that pesky Warning box but I'll see what I can find out about that.

Kasey

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

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

Hello,

It is a good idea first to start with docs from beginning. All is described here.

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.

19/03/2009
09:55
Avatar
kspeakman
Member
Members
Forum Posts: 9
Member Since:
29/01/2009
sp_UserOfflineSmall Offline

Tony,

I finally found where it indirectly says these files are required for buttons in the documentation.

First, there's the Navigating page, which says:

To use this feature we need to enable form editing. For more information refer to Installation.

Then Installation says:

  • grid.formedit.js a plugin used for form editing, including adding and deleting data.
  • jqModal.js a plugin used for form editing (modal dialogs)
  • jqDnR.js a plugin used for form editing (drag and resize)

And also later says:

If you plan to use the form editing module you should include jqModal.jsjqDnR.js and jqModal.css files in your html page.

However, it would have been much more helpful if the Navigating page documentation had instead said:

To use this feature we need to include jqModal.js, jqDnR.js, jqModal.css, and grid.formedit.js.

That's all it would have taken. It would have been just as much text in Navigating to specify the files by name, and much less cross reference for the reader. This thing is complicated to integrate already. All the cross-reference to figure things out doesn't help.

That and for someone who's already decided that the user should not be able to edit the data, when I see “form editing”, I tend to ignore that line when reading the docs, thinking that it doesn't apply to me. That's why I missed it.

I think the documentation change mentioned above would save you some questions (and therefore time).

Thanks,

Kasey

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

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

Hello,

Thanks for the recommendation. As I say writting professional documentation is not so easy. We will try to make it better.

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
10:25
Avatar
kspeakman
Member
Members
Forum Posts: 9
Member Since:
29/01/2009
sp_UserOfflineSmall Offline

Tony,

I completely agree. I'm sure you didn't know what you were signing up for when you first posted jqGrid for others to use. 🙂

I think you've been doing a great job, especially for working in your "spare time". It's probably more like a second full-time job you don't get paid for.

By the way, I'm working on a new search form for jqGrid where you can add multiple parameters. I don't know if you'd be interested in it, but I'd be pleased to offer it for integration into jqGrid releases, when it's finished.

Kasey

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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