Oct 20, 2011, 1:33 PM
How to clrear the previously edited cell values in the gridpanel
Hi friends,
I have a gridpanel. In which one column is editable. My problem is, when the user edits the other record the previously edited record should be cleared so that every point of time only once record is modified.
Here i am providing some sample code.
i use the changed record for some other task.
please help me..
I have a gridpanel. In which one column is editable. My problem is, when the user edits the other record the previously edited record should be cleared so that every point of time only once record is modified.
Here i am providing some sample code.
<ext:GridPanel ID="grdTest" runat="server" ClicksToEdit="1" EnableViewState="false"
TrackMouseOver="true">
<Store>
<ext:Store ID="Storeusers" runat="server" IgnoreExtraFields="False"
PruneModifiedRecords="True">
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="Name" Type="String" />
<ext:RecordField Name="Grade" Type="String" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
<SelectionModel>
<ext:RowSelectionModel ID="SearchUserSelectionModel" SingleSelect="true">
</ext:RowSelectionModel>
</SelectionModel>
<ColumnModel ID="ColumnModel4">
<Columns>
<ext:Column DataIndex="Name" Header="Name" Width="250">
</ext:Column>
<ext:Column DataIndex="Grade" Header="Grade" Width="100">
<Renderer Fn="gradeRenderer" />
<Editor>
<ext:ComboBox ID="gradeComboBox" runat="server" Shadow="Drop" Mode="Local"
TriggerAction="All" ForceSelection="true" Editable="false" EmptyText="Select grade"
StoreID="storeGrade" DisplayField="Name" ValueField="Id" SelectOnFocus="true"
TypeAhead="false" Resizable="true" />
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
<View>
<ext:GridView ID="GridView5" runat="server" MarkDirty="false" />
</View>
<LoadMask ShowMask="true" Msg="Processing..." />
</ext:GridPanel>
<ext:Store ID="storeGrade" runat="server">
<Reader>
<ext:JsonReader IDProperty="Id">
<Fields>
<ext:RecordField Name="Id" Type="Int">
</ext:RecordField>
<ext:RecordField Name="Name" Type="String">
</ext:RecordField>
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
var gradeRenderer = function(value) {
var r = #{storeGrade}.getById(value);
if (Ext.isEmpty(r)) {
return "";
}
return r.data.Name;
}
for example think that my grid showing three records (Grade is editable). first user changed grade of the first record, now when the user changed the second record grade i want to clear the first record grade so the at any point of time only one record grade will be changed.i use the changed record for some other task.
please help me..