PDA

View Full Version : focus grid row



arul_css
28 Feb 2013, 5:07 AM
Hi

I am using


xtype: 'gridpanel',
store: store,
id:'fId',
columns: [
{
header: "",
hideable:true,
renderer:renderRadioBox,
dataIndex: 'id'
}]

For radio button render i am using this function



function renderRadioBox(val, meta, record, rowIndex, colIndex, store){
var checkTxt='';
<?php if($_GET[action']=='edit') {
$radioId = $editSet[id];
?>
if(val==<?=$radioId?>') {
checkTxt = 'checked';
}
<?php } ?>
var a = <input value="'+ val +'" type= "radio" name="radiogroup" style="margin-left:10px;" '+ checkTxt +'/>';
return a;
}



Already selected radio button selects only radio button part of the grid row, but not the row itself

I want complete row to be selected , please help

EPV
28 Feb 2013, 6:08 AM
Here are two examples of how you can focus rows in a grid with a specific property.

1. Via the "getRowClass"
2. Via the "selectionModel"

Both examples are in the code below so comment out one of them to see the difference.

http://jsfiddle.net/EmilPennlov/KunVN/1/

Good luck!

arul_css
28 Feb 2013, 6:35 AM
Thanks for the reply.

Grid loads with (already) selected radio button, it just select radio button but not the content (row). Sorry if my last post not very clear.

EPV
28 Feb 2013, 6:49 AM
So what is wrong with my examples?

arul_css
28 Feb 2013, 6:55 AM
Hi

I need that grid value only, but nothing wrong with your example. now successful in taking it

Thanks