PDA

View Full Version : [CLOSED] Restrict the length of text a user can write into a grid cell...



Peter.Treier
Jun 07, 2013, 9:21 AM
Good Morning all

I need to restrict the length of text a user can write into a grid cell.
I've got this gris



<ext:Panel ID="pnlSpecialMentions" runat="server" Header="false" Layout="FitLayout">
<Items>
<ext:GridPanel runat="server" ID="gridSpecialMention" AutoScroll="true" Height="100px">
<Store>
<ext:Store ID="storeSpecialMention" runat="server">
<Model>
<ext:Model ID="modelSpecialMention" runat="server">
<Fields>
<ext:ModelField Name="Id" />
<ext:ModelField Name="Text" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="SpecialMentionColumnModel" runat="server">
<Columns>
<ext:Column ID="colSpecialMentionId" runat="server" Text="Id" Hidden="true" DataIndex="Id" />
<ext:Column ID="colSpecialMentionText" runat="server" Text="Text" DataIndex="Text" Flex="1" />
</Columns>
</ColumnModel>
</ext:GridPanel>
</Items>
</ext:Panel>


Is there a way to do this in markup ?

Peter

Daniil
Jun 07, 2013, 12:31 PM
Hi Peter,

Your GridPanel looks non-editable. So, how do you assume a user should type in a grid's cell.

If you were using a TextField as a Column's Editor, it would be possible to achieve it this way.

<ext:TextField runat="server" MaxLength="5" EnforceMaxLength="true" />

Peter.Treier
Jun 07, 2013, 2:09 PM
Hi Peter,

Your GridPanel looks non-editable. So, how do you assume a user should type in a grid's cell.

If you were using a TextField as a Column's Editor, it would be possible to achieve it this way.

<ext:TextField runat="server" MaxLength="5" EnforceMaxLength="true" />

Well that's an Idea, I'll see how's the look and feel !

Thanks for this
Peter