[CLOSED] [1.0] Selectable Property

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] [1.0] Selectable Property



    Thank you :)

    My questions are:

    1. if set Selectable="false" in <default> on a formpanel with 30 textboxes,
    one of those textboxes is not ready only, Do I have to set selectable property individually for all controls? (set Selectable="true" for that textbox doesn't seem to work)

    2. I need to set selectable=true/false based on DB result, default state is all ready on
    ly. "txt1.Selectable = true;" in page_load doesn't seem to do anything.



    <ext:FormPanel runat="server" Title="Width=0.25" Html="This is some content."><Defaults>
    <ext:Parameter Name="selectable" Value="false" Mode="Raw" />
    <ext:Parameter Name="anchor" Value="95%" />
    </Defaults>
    <Items>
    <ext:TextField runat="server" ID="txt1" Selectable="true"/>
    <ext:TextField runat="server" ID="txt2"/>
    <ext:TextField runat="server" ID="txt3"/>
    </Items>
    </ext:FormPanel>
  2. #2

    RE: [CLOSED] [1.0] Selectable Property

    Hi vali1993,

    Yes, this scenario is a bit of a problem. We are discussing some options.

    At the moment, the best we can recommend is using the <CustomConfig> inner property to force the "selectable" property to render.

    Example

    <ext:FormPanel runat="server" Title="Width=0.25" Html="This is some content.">
        <Defaults>
            <ext:Parameter Name="selectable" Value="false" Mode="Raw" />
            <ext:Parameter Name="anchor" Value="95%" />
        </Defaults>
        <Items>
            <ext:TextField runat="server" ID="txt1" Selectable="true">
                <CustomConfig>
                    <ext:ConfigItem Name="selectable" Value="true" Mode="Raw" />
                </CustomConfig>
            </ext:TextField>
            <ext:TextField runat="server" ID="txt2" />
            <ext:TextField runat="server" ID="txt3" />
        </Items>
    </ext:FormPanel>
    I'll keep you updated with our progress.

    Geoffrey McGill
    Founder
  3. #3

    RE: [CLOSED] [1.0] Selectable Property

    As a bit of a side note, when configuring in markup, you can now add the "Default" keyword before any property name and it will automatically add that property to the <Defaults> when serializing to the client.

    Here's the same sample as above, but without the inner <Defaults>.

    Example

    <ext:FormPanel 
        runat="server" 
        Title="Width=0.25" 
        Html="This is some content." 
        DefaultSelectable="false" 
        DefaultAnchor="95%">
        <Items>
            <ext:TextField runat="server" ID="txt1" Selectable="true">
                <CustomConfig>
                    <ext:ConfigItem Name="selectable" Value="true" Mode="Raw" />
                </CustomConfig>
            </ext:TextField>
            <ext:TextField runat="server" ID="txt2" />
            <ext:TextField runat="server" ID="txt3" />
        </Items>
    </ext:FormPanel>

    The "Defaults*" properties will not show up in intellisense, but they
    will render correctly. Although .DefaultAnchor is actually a property, so it will show up in intellisense.


    This is more of a hidden trick for optimizing markup syntax.

    Geoffrey McGill
    Founder
  4. #4

    RE: [CLOSED] [1.0] Selectable Property

    Thanks Geoffrey, that is a great tip.
    I tried adding this in the code behind , doesn't seem to work. do you see i am doing something wrong here. thanks again

    txt1.CustomConfig.Add(new ConfigItem("Selectable","true", ParameterMode.Raw));
  5. #5

    RE: [CLOSED] [1.0] Selectable Property

    Hi,

    Please use camel case "selectable"
    We are thinking to add automatic name conversation
  6. #6

    RE: [CLOSED] [1.0] Selectable Property

    Thanks!! it works! :)
  7. #7

    RE: [CLOSED] [1.0] Selectable Property

    ok, we've added another cool hack/trick...

    If you add an "X" in front of any property value, the "X" will force the property to render.

    Here's your original sample now using all the markup syntax optimizations.

    Example

    <ext:FormPanel 
        runat="server" 
        Title="Width=0.25" 
        Html="This is some content." 
        DefaultSelectable="false" 
        DefaultAnchor="95%">
        <Items>
            <ext:TextField runat="server" ID="txt1" XSelectable="true" />
            <ext:TextField runat="server" ID="txt2" />
            <ext:TextField runat="server" ID="txt3" />
        </Items>
    </ext:FormPanel>
    You can still continue to use the <CustomConfig> in markup.

    If you want to override the value in code-behind, you *must* use the CustomConfig collection as you demonstrated above.

    This is only a markup trick.

    Hope this helps.

    Geoffrey McGill
    Founder
  8. #8

    RE: [CLOSED] [1.0] Selectable Property

    SVN Revision #2673

    Geoffrey McGill
    Founder
  9. #9

    RE: [CLOSED] [1.0] Selectable Property

    perfect! Thanks again!
  10. #10

    RE: [CLOSED] [1.0] Selectable Property

    Thank you for you help. one more question on this, if 'txt1' is a value from database,
    is there a way i can still use this method?
    txt1.CustomConfig.Add(new ConfigItem("Selectable","true", ParameterMode.Raw));
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] [1.3] RowExpander TextField not selectable.
    By drgw74 in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: May 31, 2012, 11:12 AM
  2. [CLOSED] TreePanel node not selectable
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 18
    Last Post: Jun 30, 2011, 8:33 PM
  3. [CLOSED] GridPanel not selectable
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 11, 2011, 5:05 PM
  4. [CLOSED] [1.0] MenuSeparator Selectable?
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 17, 2010, 3:29 PM
  5. [CLOSED] How to make TextArea non selectable
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Feb 05, 2010, 3:43 AM

Posting Permissions