connecting dgrid with a dialog
-
05-06-2021 - |
Frage
Hi this is the cod of my dGrid html:
<table id="Assign_Segments" class="dGrid"
dojoType="dgrid.GridFromHtml" style="width:700px">
<tbody>
<tr>
<th data-dgrid-column="{field:'InputCell', sortable:true}">
<bean:message key="IDD_POPSEG_PAGE.IDC_LBL_INPUTCELL" bundle="flowchart"/>
</th>
<th data-dgrid-column="dgrid.Editor({field:'Segment',
sortable:false, widgetArgs: segmentSelectOptions}, dijit.form.Select, 'click')">
<bean:message key="IDD_POPSEG_PAGE.IDC_LBL_SEGNAME" bundle="flowchart"/></th>
</tr>
</tbody>
</table>
I have wired them this using the folowing:
dojo.global.segmentSelectOptions = function(object){
var opts = [{
'label': 'seg1',
'value': 'seg1'
}, {
'label':'New Segment...',
'value':'new'
}, {
'label': 'seg2',
'value': 'seg2'
}];
return { onChange: function(newValue){
if(newValue=='new'){
var dlg = dijit.getWidget('CreateFolder','dijit.Dialog');
dlg.show();
}
},
class: "fullWidthWidget",
options: opts};
};
This code as you can see, opens a dialog. Now I want to access the cell that i have selected in the dgrid
when I press a particular button on the dialog and change the value of the cell based on the inputs in the dialog. How do I access the cell from that function? The thing is it could be any cell in the dgrid and they don't have id to use dijit.byId();
Please help me out!
Lösung
The solution is to give a callback from the hide() of the dialog to a function where you alter the grid. However, you need to use this line before using the put() statement of your store:
grid.dirty = {};
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow