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
possible navgrid bugs?
24/02/2010
11:23
Avatar
yial2
Member
Members
Forum Posts: 14
Member Since:
24/02/2010
sp_UserOfflineSmall Offline

Files used:

1. JQuery 1.3.2

2. JqGrid 3.5.3

3. JQuery UI 1.7.2(core.js, draggable.js, resizable.js, dialog.js)

When a JqGrid is placed inside a dialog window, if "add"/"delete" buttons are enabled

(e.g. { edit: false, add: true, del: true, refresh: false, search: false })

the navgrid seems to duplicated the "add"/"delete" buttons. "Add" button will be rendered twice, same with"Delete" button

            $("#divModal").dialog({
                autoOpen: false,
                modal: true,
                title: "abc"
            });

divModal is the div contains the table and pager for the JqGrid.

However, when I comment out the dialog function to have divModal as a regular div on the page instead of inside a dialog window, the navgrid render the button correctly. Any thoughts/reply will be greatly appreciated! Thanks in advance.Cool

24/02/2010
20:03
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

This is really strange - can you please share your code or provide a link to the problem.

Please all the code if you do so.

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.

25/02/2010
08:16
Avatar
yial2
Member
Members
Forum Posts: 14
Member Since:
24/02/2010
sp_UserOfflineSmall Offline

Hi Tony,

I think I know where the problem is, but I don't know "why" it happens

Following are the code to my program

<script src="<%= Url.Content("~/Scripts/jqueryUI/development-bundle/ui/ui.core.js") %>" type="text/javascript"></script>
<script src="<%= Url.Content("~/Scripts/jqueryUI/development-bundle/ui/ui.draggable.js") %>" type="text/javascript"></script>
<script src="<%= Url.Content("~/Scripts/jqueryUI/development-bundle/ui/ui.resizable.js") %>" type="text/javascript"></script>
<script src="<%= Url.Content("~/Scripts/jqueryUI/development-bundle/ui/ui.dialog.js") %>" type="text/javascript"></script>
<script src="<%= Url.Content("~/Scripts/jqGrid/js/i18n/grid.locale-en.js") %>" type="text/javascript"></script>
<script src="<%= Url.Content("~/Scripts/jqGrid/js/jquery.jqGrid.min.js") %>" type="text/javascript"></script>
<script type="text/javascript">
    $(function() {
        $("#divModal").dialog({
            autoOpen: false,
            overflow: true,
            title: "testing modal"
        });

        $("#btnPopUp").click(function() {
            $("#divModal").dialog('open');
        });
    });
</script>

<table id="list" cellpadding="0" cellspacing="0"></table>
<div id="pager"></div>
<input type="button" id="btnPopUp" value="PopUp" />

<div id="divModal">
    <script type="text/javascript">
        $(function() {
            $("#list2").jqGrid({
                url: '/Home/Test3Data/',
                datatype: 'json',
                mtype: 'GET',
                colNames: ['Name'],
                colModel: [
                { name: 'Name', index: 'Name', width: 680, align: 'left'}],
                pager: '#pager2',
                rowNum: 5,
                rowList: [5, 10, 20, 50],
                sortname: 'Name',
                sortorder: "desc",
                viewrecords: true,
                imgpath: '<%= Url.Content("~/Scripts/jqueryUI/css/ui-lightness/images") %>',
                caption: 'My first grid'
            });
            $("#list2").navGrid('#pager2', { add: true, del: true, edit: false, refresh: false, search: false, view: false }, {}, {}, {}, {}, {});
        });
    </script>
    <table id="list2" cellpadding="0" cellspacing="0"></table>
    <div id="pager2"></div>
</div>

The code above will generate the error I post before. If you move the javascript "inside" the divModal out of it(outside the divModal), there will not be any problem. You may ask why I didn't put all the javascript in one place, the reason is that divModal is actually a user control I created and use repeatedlly on some other pages. I am happy to pin point down the problem, but I guess this is not a bug. Wink

26/02/2010
21:49
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks for sharing the code.

IMHO, this is not a jqGrid bug, but rather a dialog one. Insetead I will try to investigate the problem

Thanks again

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

20/05/2010
17:46
Avatar
julz
New Member
Members
Forum Posts: 2
Member Since:
20/05/2010
sp_UserOfflineSmall Offline

any news about a fix for this bug ?

I encounter the same problem since I upgrade to the 3.6.5 version...

Thx !

20/05/2010
18:30
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Looking into the code, you will need to call navGrid only once.

The grid itself can determine if it is already constructed and gracefully exit from this situation, but not the navGrid, since every clicking of the button call it again and again.

One possible solution is to define variable if it is called and do not call it if it is already constructed

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/05/2010
19:04
Avatar
julz
New Member
Members
Forum Posts: 2
Member Since:
20/05/2010
sp_UserOfflineSmall Offline

Hi Tony,

thks for the tips ! Actually you were right, my toolbar was initialized twice !

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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