Hello
I have a datagrid and subgrid as below
var conf = {
options:{
fitColumns:true,
toolbar:'#toolbar',
columns:[[
{field:'name',title:'name',width:12},
{field:'amt1',title:'amt1',width:10,align:'right'},
{field:'amt2',title:'amt2',width:10,align:'right'},
{field:'total',title:'Total',width:10,align:'right',
styler: function(value,row,index){
if (value.charAt(0) == '-'){
return 'color:red;';}
}},
{field:'adjust',title:'Adjust',width:10,align:'right',
styler: function(value,row,index){
if (value.charAt(0) == '-'){
return 'color:red;';}
}},
{field:'balance',title:'Balance',width:10,align:'right',
styler: function(value,row,index){
if (value.charAt(0) == '-'){
return 'color:red;';}
}},
]],
},
subgrid:{
options:{
fitColumns:true,
singleSelect:true,
autoUpdateDetail:false,
url:'scripts/database/get_costs.php',
foreignField:function(row){
var dp = $('#yearCombo').combobox('getValue');
return {
name:row.name,
year:dp
}},
columns:[[
{field:'date',title:'Date',width:8},
{field:'cst1',title:'Cost 1',width:7,halign:'center',align:'right',
styler: function(value,row,index){
if (value.charAt(0) == '-'){
return 'color:red;';}
}},
{field:'cst2',title:'Cost 2',width:7,halign:'center',align:'right'},
{field:'total_cst',title:'Total',width:7,halign:'center',align:'right'},
]],
}
}
};
I have a form to to edit the values from the sub grid, however this enatils adding a button to each subgrid line
Is there a way to get the row values from a selected sub grid line, without adding a button on each sub grid line..., instead by using a button on the toolbar
Thank you