Jan 10, 2012, 8:47 AM
RowEditor Plugin with Custom Search Box focus problem
I am using RowEditor Plugin in a GridPanel. If someone choose the value from list (Custom Search Box) in RowEditor Plugin which is already exist then it will showing a confirmbox. If we choose "NO" button the it will clear the value of Custom Search Box and focus it.
..........
..........
<Editor>
<ext:ComboBox ID="Combobox1" runat="server" DisplayField="isin" ValueField="isin" TypeAhead="false" LoadingText="Loading..." PageSize="10" HideTrigger="true" ItemSelector="div.search-item" MinChars="1">
<Store>
<ext:Store ID="Store2" runat="server" AutoLoad="false">
<Proxy>
<ext:HttpProxy Method="GET" Url="AutoCompleteHandler.ashx" />
</Proxy>
<Reader>
<ext:JsonReader Root="employees" TotalProperty="total">
<Fields>
<ext:RecordField Name="empno" Mapping="EmpNo" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
<Listeners>
<Select Handler="checkValue(this.value);" />
</Listeners>
<Template ID="Template1" runat="server">
<Html>
<tpl for=".">
<div class="search-item">
<h3>{empno}</h3>
</div>
</tpl>
</Html>
</Template>
</ext:ComboBox>
</Editor>
..........
..........
<ext:XScript ID="XScript1" runat="server">
<script type="text/javascript">
var checkValue = function(empno) {
Ext.net.DirectMethods.CheckValue(empno, {
success: function (result) {
if (result)
{
Ext.Msg.confirm("Message", "If you continue then it will be over written", function (btn, text) {
if (btn == 'no') {
rowEditor.on("show", function () {
Combobox1.focus(true, true);
});
}
});
}
},
failure: function (errorMsg) {
Ext.Msg.alert('Error - ', errorMsg);
}
});
}
</script>
</ext:XScript>
Please help me
Last edited by abhijit; Jan 10, 2012 at 8:54 AM.