[ADDED] [V0.7.0] ComboBox SelectedIndex

Page 1 of 2 12 LastLast
  1. #1

    [ADDED] [V0.7.0] ComboBox SelectedIndex

    Hello,

    Could we get a SelectedIndex which would allow getting and setting the selected index of the store?

    Cheers,
    Timothy
  2. #2

    RE: [ADDED] [V0.7.0] ComboBox SelectedIndex

    I'm pushing this one, would be really nice to know what index of the local store is selected. Would save me having to do things like:

    if (ComboBox1.SelectedItem.Value.Equals("Create a new one ..."))
    {
    
    }
    When I know "Create a new one ..." is always the first item in the index.

    Cheers,
    Timothy
  3. #3

    RE: [ADDED] [V0.7.0] ComboBox SelectedIndex

    Hi Timothy,

    I believe that row index in grid panel and index in store always same. If you get selected row with row index equal one then in store this record will be with index one. But the record position in store can be changed on client (for example, after local sorting). Therefore records in store on client can located in other positions then you set on server. Better use record ID


  4. #4

    RE: [ADDED] [V0.7.0] ComboBox SelectedIndex

    Vlad,

    Good thinking, the SelectedRecordID property would be a good
    idea (just like the SelectionModel).

    However, would be still extremely helpful if we
    have a SelectedIndex which would obviously reflect the client sort order (read only?)

    Cheers,

    Timothy
  5. #5

    RE: [ADDED] [V0.7.0] ComboBox SelectedIndex

    Oops,

    you wrote about ComboBox but i didn't pay attention on it (i wrote about GridPanel :( )


  6. #6

    RE: [ADDED] [V0.7.0] ComboBox SelectedIndex

    Oops, OK well you think something for the ComboBox might be worthwhile? Here is what I'm doing:

            Provinces.Listeners.Load.Handler = String.Format(@"
                    this.insert(0, new Ext.data.Record( {{ Text: 'Create new Province ...', Value: '{0}' }} ) );
                    this.insert(0, new Ext.data.Record( {{ Text: '----', Value: '' }} ) );
                ", Guid.NewGuid());
    Then when someone selects something on the drpProvince (which points at the Province store) I check to enable or disable the drpCity:

    ...
            drpCity.Disabled = drpProvince.SelectedItem.Text.Equals("----") ||
                                drpProvince.SelectedItem.Text.Equals("Create new Province ....");
    ...
    Really annoying having to check that the first 2 items in the list are not selected :)

    ...
            drpCity.Disabled = drpProvince.SelectedIndex <= 1;
    ...
    Would be much easier :)

    Cheers,
    Timothy
  7. #7

    RE: [ADDED] [V0.7.0] ComboBox SelectedIndex

    Possible? Would like to know so I can mark my code for the changes.
  8. #8

    RE: [ADDED] [V0.7.0] ComboBox SelectedIndex

    Hi Timothy,

    yes, it is possible. Just before release of v0.6 very busy. We'll implement it in few days

  9. #9

    RE: [ADDED] [V0.7.0] ComboBox SelectedIndex

    No excuse, get it done now! Just kidding, thanks vlad ... I've marked the spots in my code for when it's ready ;)

    Cheers,
    Timothy
  10. #10

    RE: [ADDED] [V0.7.0] ComboBox SelectedIndex

    Hi Timothy,

    The SelectedIndex property was added. Please note that it is a read-only property

Page 1 of 2 12 LastLast

Similar Threads

  1. [OPEN] [#147] SelectedIndex in ComboBox
    By amitpareek in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Feb 13, 2013, 7:12 AM
  2. Replies: 11
    Last Post: Feb 06, 2012, 2:56 PM
  3. ComboBox and SelectedIndex
    By glenh in forum 1.x Help
    Replies: 3
    Last Post: Oct 18, 2010, 7:57 AM
  4. [FIXED] [V0.7] ComboBox SelectedIndex
    By Timothy in forum Bugs
    Replies: 9
    Last Post: Aug 20, 2009, 3:19 PM
  5. Replies: 2
    Last Post: Oct 06, 2008, 11:27 AM

Posting Permissions