Oct 21, 2011, 3:04 AM
How to check exist object name in gridpanel list object in code behind or javascript?
Hi
Please give me an example how to check exist object in my gridpanel
I have a grid with a store
Second: I want check if ProvinceName exist in db, show a message or something to alert and stop saving. Can i check it on client side?
Thanks for help!
Please give me an example how to check exist object in my gridpanel
I have a grid with a store
<ext:Store ID="Store1"
runat="server"
OnBeforeStoreChanged="Store1_BeforeChanged"
OnAfterStoreChanged="Store1_AfterChanged"
OnBeforeRecordInserted="Store1_BeforeInserted"
OnBeforeRecordUpdated="Store1_BeforeUpdated"
OnBeforeRecordDeleted="Store1_BeforeDeleted"
OnRefreshData="Store1_RefreshData"
>
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="ProvinceID" Type="String" />
<ext:RecordField Name="ProvinceName" Type="String" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
with ColumnModel<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column DataIndex="ProvinceID" Header="Ký hiệu" Width="100" >
<Editor>
<ext:NumberField ID="NumberField1" runat="server" AllowBlank="false" AllowDecimals="true" AllowNegative="false">
</ext:NumberField>
</Editor>
</ext:Column>
<ext:Column DataIndex="ProvinceName" Header="Tên tỉnh" Width="200">
<Editor>
<ext:TextField ID="TextField2" runat="server" AllowBlank="false" />
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
I have already done inserte, update, delete data record on my gridpanel directly and have a Save button to Saves All Change. But validator doesn't work. For example, when i insert new record, validator focus cell error, but when i click Save button, record has been added to database without error message. Second: I want check if ProvinceName exist in db, show a message or something to alert and stop saving. Can i check it on client side?
Thanks for help!