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
tableToGrid & selCol with input fields
13/11/2009
05:52
Avatar
Sloub
France
Member
Members
Forum Posts: 4
Member Since:
13/11/2009
sp_UserOfflineSmall Offline

Hello,

I'm trying to use jqGrid on a complex existing table.

But, it seems the select row does not perform on input fields.

<table id="mytable">
<tr>
    <th> header 1 </th>
    <th> header 2 </th>   
</tr> 
<tbody> 
<tr>
<td> data 1 </td>
<td><input type="text" value="data1"></td>
</tr>
<tr>
<td> data 1 </td>
<td>data 1</td>
</tr>
</tbody>
<table>

Using tableToGrid method, when I click on the input field, il does not select the row.

Is there something I don't see, or is it an issue ?

Thank's for your help.

Sloub

13/11/2009
09:39
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

I think its a deliberate feature... usually, you want clicks on inputs, selects and links to be handled by the object clicked on, and not by the grid, and thats what the click handler does.

There is a workaround, which is to supply your own beforeSelectRow handler, and do whatever you want there:

function myBeforeSelectRow(sid, e) {
        var grid = $(e.target).closest("table.ui-jqgrid-btable");
        var td = e.target;
        if (td.tagName == 'A' || td.tagName == 'INPUT' || td.tagName == 'TEXTAREA' || td.tagName == 'OPTION' || td.tagName == 'SELECT' )

        {

            /* handle whichever special objects you want */

            grid.jqGrid("setSelection", sid, true); // or whatever

            return false

        }

        return true; // let the grid handle everything else the default way...

   }

@Tony - it might be nice if the beforeSelectRow handler could tell the grid to ignore the type of the target element, eg by returning -1.

Mark

16/11/2009
02:46
Avatar
Sloub
France
Member
Members
Forum Posts: 4
Member Since:
13/11/2009
sp_UserOfflineSmall Offline

Thank's Mark.

I'm going to have a look at that event I did not know.

Sloub

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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