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
This topic is locked No permission to create posts
sp_Feed Topic RSS sp_TopicIcon
Celledit "leaking" edit boxes?
15/03/2009
15:31
Avatar
aaronsher
aaronsher
Member
Members
Forum Posts: 16
Member Since:
08/03/2009
sp_UserOfflineSmall Offline

I have a grid with cellEdit set to true, and no custom editing callbacks at all. I'm having a problem with the following sequence:

  1. Select cell 1 (edit box opens) and make a change
  2. Select cell 2 (first edit box closes, red triangle appears, server request is made, second edit box opens)
  3. Select cell 1 again

At this point, I would expect the second edit box to close, a server request to be made, and the first edit box to reopen. However, what actually happens is that the first edit box reopens without the second one closing or a server request being made. At this point, I'm effectively editing two cells at once, though I can never get the second one to commit its changes.

Anybody have any idea how to make this stop happening? On a related note, anybody have any idea how to get rid of the damn red triangle after I've committed the changes to the server? I don't really understand the purpose of the red triangle, but I have no need to tell the user that they've just changed a cell.

Thanks,
   Aaron

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

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

Hello,

What version of jqGrid do you use and on wich browser is this situation?

Could you please send a link to the problem, or at least post the grid configuration?

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.

17/03/2009
17:45
Avatar
aaronsher
aaronsher
Member
Members
Forum Posts: 16
Member Since:
08/03/2009
sp_UserOfflineSmall Offline

I'm using jqGrid 3.4.1, and this is on Firefox 3.0.7 on the Mac. The page isn't hosted externally yet, but here's the grid configuration (note that I tried removing the callbacks, and it didn't solve the problem):

    $('#items').jqGrid(
    {
        // Original data request
        url:'Main.php',
        postData: {"action":"requestItems", "selectedUserID":selectedUserID},

        // Grid attributes
        caption: "Items",
        imgpath: "lib/jqGrid/themes/basic/images",
        hidegrid: false,
        datatype: 'json',
        mtype: 'POST',
        height: "100%",
       
        // Columns
        colNames:['Name', 'Category', '#Req', 'Price'],
        colModel:
        [
            {
                name:'item_name',
                index:'item_name',
                width:150,
                sortable:true,
                editable:true,
            },
            {
                name:'item_category',
                index:'item_category',
                sortable:true,
                editable:true
            },
            {
                name:'num_requested',
                index:'num_requested',
                width:100,
                sortable:true,
                editable:true
            },
            {
                name:'item_price',
                index:'item_price',
                width:100,
                sortable:true,
                editable:true
            }
        ],
       
        // Editing
        cellEdit: true,
        cellurl: "Main.php",
        beforeSubmitCell: onGridCellEditCommitting,
        afterSaveCell: onGridCellEditEnded,
        afterSubmitCell: onGridCellEditComplete,
       
        // Selection
        multiselect: true,
        onCellSelect: onSelectItem,
       
        // Other callbacks
        loadComplete: onGridLoadComplete
    });

Thanks,
   Aaron

19/03/2009
05:49
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Could you please try with FF on Windows or with Safari?

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/03/2009
14:35
Avatar
aaronsher
aaronsher
Member
Members
Forum Posts: 16
Member Since:
08/03/2009
sp_UserOfflineSmall Offline

Sorry for the delay, this is a personal project so I have to work around the damn job. 🙂

The behavior is exactly the same in FF (3.0.7) for Windows. Here's a screen shot:

Image Enlarger

Unfortunately, my site is badly broken in Safari and IE at the moment, so I can't try it there.

Any suggestions?

Thanks,
   Aaron

21/03/2009
10:41
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I see onCellSelect event - this is not connected with cell editing. Instead could you please try to use onSelectCell instead

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.

21/03/2009
20:24
Avatar
aaronsher
aaronsher
Member
Members
Forum Posts: 16
Member Since:
08/03/2009
sp_UserOfflineSmall Offline

I tried various combinations of this, with no effect. The callbacks have nothing to do with this behavior - it still occurs with this grid definition:

            ownGrid.jqGrid(
            {
                // Original data request
                url:'Main.php',
                postData: {"action":"requestItems", "selectedUserID":selectedUserID},
       
                // Grid attributes
                caption: "Items",
                imgpath: "lib/jqGrid/themes/basic/images",
                hidegrid: false,
                datatype: 'json',
                mtype: 'POST',
                height: "100%",
               
                // Columns
                colNames:['Name', 'Category', '#Req', 'Price'],
                colModel:
                [
                    {
                        name:'item_name',
                        index:'item_name',
                        width:150,
                        sortable:true,
                        editable:true
                    },
                    {
                        name:'item_category',
                        index:'item_category',
                        sortable:true,
                        editable:true
                    },
                    {
                        name:'num_requested',
                        index:'num_requested',
                        width:100,
                        sortable:true,
                        editable:true
                    },
                    {
                        name:'item_price',
                        index:'item_price',
                        width:100,
                        sortable:true,
                        editable:true
                    }
                ],
               
                // Editing
                cellEdit: true,
                cellurl: "Main.php",
//                beforeSubmitCell: onGridCellEditCommitting,
//                afterSaveCell: onGridCellEditEnded,
//                afterSubmitCell: onGridCellEditComplete,
               
                // Selection
                multiselect: true,
//                onCellSelect: onSelectItem,
//                onSelectCell: onSelectItem,
               
                // Other callbacks
//                loadComplete: onGridLoadComplete

           });

Also, looking at the code, I see onCellSelect but not onSelectCell, at least in grid.base.js. Am I missing something?

Thanks,
   Aaron

22/03/2009
09:13
Avatar
aaronsher
aaronsher
Member
Members
Forum Posts: 16
Member Since:
08/03/2009
sp_UserOfflineSmall Offline

Here's a clue - when the edit box doesn't disappear, it's because restoreCell doesn't get called. I'll keep hunting and see if I can figure out why that is.

Aaron

22/03/2009
09:34
Avatar
aaronsher
aaronsher
Member
Members
Forum Posts: 16
Member Since:
08/03/2009
sp_UserOfflineSmall Offline

OK, I know what's going on, but I don't know why this (presumably) works for everyone else. Here's the sequence (all line numbers refer to grid.celledit.js):

- select cell 1
    editCell is called
        line 43: length == 0, so no call is made to saveCell or restoreCell
        line 79: savedRow is assigned
- modify cell 1
- select cell 2
    editCell is called
        line 43: length == 1, so saveCell is called
            saveCell performs a POST
        line 79: savedRow is assigned
        saveCell POST complete callback is triggered
            line 205: savedRow cleared
- select cell 3
    editCell is called
        line 43: length == 0, so no call is made to saveCell or restoreCell

So, the problem is the ordering of the assignment to savedRow on line 79 and the POST complete callback, which clears that variable. Since the callback occurs after the assignment, savedRow ends up clear, and the next call to editCell doesn't call restoreCell, so the edit box doesn't get removed.

Any idea what to do about this?

Thanks,
   Aaron

22/03/2009
09:38
Avatar
aaronsher
aaronsher
Member
Members
Forum Posts: 16
Member Since:
08/03/2009
sp_UserOfflineSmall Offline

Incidentally, I've upgraded to jqGrid 3.4.3 and the problem is still there.

Thanks,
   Aaron

24/03/2009
01:55
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Do you have any other content within a cell? I mean other html tags.

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
19:51
Avatar
aaronsher
aaronsher
Member
Members
Forum Posts: 16
Member Since:
08/03/2009
sp_UserOfflineSmall Offline

Here's the content that's (currently) getting put into the grid:

{
   "page":1,
   "total":1,
   "records":6,
   "rows":[
      {"id":"6","item_name":"Item2d","item_category":"Cat2 modified",
         "num_requested":"1","item_price":"$1"},
      {"id":"5","item_name":"Item1","item_category":"Cat1 mod",
         "num_requested":"1-3","item_price":"$2"},

      {"id":"7","item_name":"Item3a","item_category":"George",
         "num_requested":"1","item_price":"$3"},
      {"id":"20","item_name":"item13","item_category":"Cat13",
         "num_requested":"","item_price":""},
      {"id":"21","item_name":"item14","item_category":"Cat14",
         "num_requested":"","item_price":""},
      {"id":"22","item_name":"item15","item_category":"",
         "num_requested":"","item_price":""}
   ]
}

So, no.

Thanks,
   Aaron

24/03/2009
19:53
Avatar
aaronsher
aaronsher
Member
Members
Forum Posts: 16
Member Since:
08/03/2009
sp_UserOfflineSmall Offline

Oh, in order for that to make sense, I'd better say that I've added this to the grid declaration:

                jsonReader:{
                    root: "rows",
                    page: "page",
                    total: "total",
                    records: "records",
                    repeatitems: false,
                    id: "id",
                    userdata: "userdata"
                 },
               
Aaron

25/03/2009
10:51
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I Will test this having this information - using your config and data.

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/03/2009
11:16
Avatar
aaronsher
aaronsher
Member
Members
Forum Posts: 16
Member Since:
08/03/2009
sp_UserOfflineSmall Offline

Thanks for the help. If you'd like, I'll send you the whole site source; this is a personal project, so there's nothing proprietary in it.

Also, when I get a chance, I'll see if I can make a client-only version that exhibits the behavior.

Aaron

03/04/2009
13:18
Avatar
aaronsher
aaronsher
Member
Members
Forum Posts: 16
Member Since:
08/03/2009
sp_UserOfflineSmall Offline

Here's the simplest code I can come up with that illustrates the problem.

<html>
    <head>
        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"></meta>
       
        <!-- Library scripts -->
        <script type="text/javascript" src="lib/jquery-1.3.2.js"></script>
        <script type="text/javascript" src="lib/jqGrid/jquery.jqGrid.js"></script>
        <script type="text/javascript">
            $(document).ready(function ()
            {
                $('#grid').jqGrid(
                {
                    datatype: 'clientSide',

                    // Columns
                    colNames:['Name'],
                    colModel:
                    [
                        {
                            name:'item_name',
                            index:'item_name',
                            editable:true
                        }
                    ],
                   
                    // Editing
                    cellEdit: true,
                    cellurl: "Main.php"
                });
   
                var data =
                [
                    { item_name: "Item1"},
                    { item_name: "Item2"},
                    { item_name: "Item3"}
                ];
       
                for (var cnt = 0; cnt < data.length; ++cnt)
                    $('#grid').addRowData(cnt, data[cnt]);
            });
        </script>
    </head>

    <body>
        <table id="grid"></table>
    </body>
</html>

Recall that I'm running under Firefox 3.0.8 on the Mac. Please offer any insight you can - if this can't be fixed, I'm not going to be able to use jqGrid, and I'd really rather not have to try to integrate a different grid control at this point.

Thanks,
    Aaron

03/04/2009
13:20
Avatar
aaronsher
aaronsher
Member
Members
Forum Posts: 16
Member Since:
08/03/2009
sp_UserOfflineSmall Offline

One additional point - I edited the Main.php script so that it exits immediately, without doing anything at all. I don't know how to make cell editing work without a URL, though it seems like you ought to be able to edit the local data only.

Aaron

07/04/2009
03:17
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks for investigation.

Humm - in my FF 3.0.8 on Windows all seems to work ok.

To use the cell editing local add

cellsubmit: 'clientArray' - see docs

Could you plese test this sample on Windows machine?

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.

07/04/2009
08:28
Avatar
aaronsher
aaronsher
Member
Members
Forum Posts: 16
Member Since:
08/03/2009
sp_UserOfflineSmall Offline

On Windows, using local cell submission, I get a different symptom - I don't get the leaked edit boxes, but just selecting the three cells in order (1, 2, then 3), the first row disappears.

Aaron

08/04/2009
07:01
Avatar
aaronsher
aaronsher
Member
Members
Forum Posts: 16
Member Since:
08/03/2009
sp_UserOfflineSmall Offline

If you'd like me to examine some internal state of the jqGrid code, I'd be happy to help out. Given that I can reproduce this 100% and you can't, it might make more sense to try to debug it remotely.

Another possibility would be to do some sort of a screen-sharing thing and debug it live, or even just to use VNC for you to debug it directly on my machine.

Please let me know how I can help.

Thanks,
   Aaron

This topic is locked No permission to create posts
Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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