First, set flexigrid to single-choice mode:
$ ("# Subusers "). flexigrid ({datatype: 'json', width: 237, height: 267, singleselect: True, colmodel: [{hide: '_ id', name: 'id', width: 158, sortable: True, align: 'left'}, {display: email, name: 'e-mail ', width: 158, sortable: True, align: 'left '}, {display: Description, name: 'description', width: 77, sortable: True, align: 'left'},]});
Note the singleselect: True setting above.
There are three columns. I want to obtain the first column of the selected row. The Code is as follows:
$ ('# Subusers'). Each (function () {id = parameter ('.trselected'{.children('td'{.eq(0).children('div'{.html ();});
Subusers is the ID of the table element corresponding to flexigrid. Therefore, $ ('# subusers') represents the jquery object corresponding to the table. Then, the each function traverses this jquery object, and only one of them is the tbody.
Flexigrid will add all selected rows. the trselected style, so the $ ('. trselected') to get the tr line, then find the child element layer by layer through the Children method, and finally find the value in the DIV, which is the data displayed in the first column.