Jun 22, 2011, 5:44 PM
[CLOSED] Cancel editor
I have an editor for a column in a grid
I have a rendered that "disables" the editor based on certain criteria...
<ext:Column DataIndex="WIWeight" Header="What-If" Width="70" Align="Center" ColumnID="WIWeight"
Sortable="false">
<Editor>
<ext:TextField ID="WIWeightEditor" runat="server" MaskRe="/[0-9\.\-]/">
<Listeners>
<Render fn="editorRender" />
</Listeners>
</ext:TextField>
</Editor>
<EditorOptions>
<Listeners>
<Complete Handler="UpdateTotal()" Buffer="20" />
</Listeners>
</EditorOptions>
<Renderer Fn="gridRender" />
</ext:Column>
I have a rendered that "disables" the editor based on certain criteria...
var editorRender = function editorRender(item) {
//set index based on id.
(item.id.indexOf('Weight1') > -1) ? colIndex = 2 : (item.id.indexOf('Weight2') > -1) ? colIndex = 3 : colIndex = 4;
if ((hidPortType.getValue() == "Actual") || (hidPortType.getValue() == "Manual"))
this.setDisabled(true);
else if ((hidPortWeightType.getValue() == 'NoRebalanceBeginning') && (colIndex == 2))
this.setDisabled(true);
else if ((hidPortWeightType.getValue() == 'NoRebalanceEnding') && (colIndex == 3)) {
this.setDisabled(true);
}
// gridFund.getColumnModel().columns[whatIfIndex]
}
Is there any other way to "disable" the editor? Ideally, I'd like to either popup a message saying this isn't editable, or, cancel the event all together because right now the disables looks terrible.
Last edited by Daniil; Jun 27, 2011 at 12:53 PM.
Reason: [CLOSED]