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
idPrefix kills addRow method
20/04/2012
18:46
Avatar
snoopy
Member
Members
Forum Posts: 15
Member Since:
05/03/2012
sp_UserOfflineSmall Offline

Hi everybody,

I think I found this bug:

when using the jqGrid Option "idPrefix" to make sure there are unique tr - id's with multiple grids on the page and firing the 'addRow' method a new row is inserted in the grid but it doesn't enter edit mode, no input elements are created.

I assume the 'addRow' method uses the row-id "new_row" for selecting the inserted row, but the idPrefix is prefixed at the tr-id, as it should, so it is called 'prefixnew_row' and the addRow method doesn't find the new row for entering edit mode.

Could that be right?

Greetings

Snoopy

20/04/2012
18:48
Avatar
snoopy
Member
Members
Forum Posts: 15
Member Since:
05/03/2012
sp_UserOfflineSmall Offline

I forgot: I'm on Version 4.3.2 ...

20/04/2012
18:59
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

A test case is highly apreciated.

I think you use a datatype local.

In this case it is highly recommendet to set a key:true option in the column which act as id.

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.

21/04/2012
10:09
Avatar
snoopy
Member
Members
Forum Posts: 15
Member Since:
05/03/2012
sp_UserOfflineSmall Offline

Hi tony,

nope, I use datatype "json". I made a little test to validate the behaviour:

HTML:

    <table id="tblGridA"></table>
    <button type="button" id="btnAddA">+</button>

JavaScript:

$('#tblGridA').jqGrid({
            datatype:'json',
            url:'test1.php',
            idPrefix:'PreA',
            colNames:['Col1','Col2'],
            colModel:[
                      {
                          name:'col1',
                          editable:true
                      },
                      {
                          name:'col2',
                          editable:true
                      }
                    ]
        });

        $('#btnAddA')
            .button()
            .click(function() {
                $('#tblGridA').jqGrid('addRow');
            });

Server sider PHP ("test1.php"):

for($i=0;$i<10;$i++) {
    $return['rows'][$i]['id']=$i;
    $return['rows'][$i]['cell']=array('A'.$i,'B'.$i);
}
echo json_encode($return);

Result after loading:

[Image Can Not Be Found]

Result after click on Button:

[Image Can Not Be Found]

Regards

snoopy

21/04/2012
11:27
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Found the problem.Fixed in GitHub

Thank you.

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.

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