[CLOSED] How to handle combobox loaded remotely and Empty Value?

  1. #1

    [CLOSED] How to handle combobox loaded remotely and Empty Value?

    Hi,

    I'm wonder if there any way to handle situation like this.

    In my app I got ComboBox loaded remotely by handler.

    I've applied EmptyText and EmptyValue for this comboBox but after this ComboBox is reloaded this empty Text(string) and EmptyValue(int) disapear.
    I needed for changing selected value from some to empty(requirements)

    So How can I do this?
    I've just try to add 1 extra value each reload which contains emptytext and emptyValue inside returned json. Even though sometimes this Value isn't at firstplace from top.
    That's how I tryed to do this:
    List<MyComboBoxClass> list = GetItems();
    list.Insert(0, new MyComboBoxClass("--empty--",0);
    So how would you guys do this?

    Thanks,
    ViDom
    Last edited by Daniil; Jan 28, 2013 at 3:42 PM. Reason: [CLOSED]
  2. #2
    Hi @ViDom,

    I don't think there is a possibility to use EmptyValue by the way you need.

    EmptyValue means a ComboBox's value to consider as null, i.e. no value.

    If you need some default value, what about to load it from a handler as well, i.e. at the same time with other items. Then select this default value within a Store's Load listener.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @ViDom,

    I don't think there is a possibility to use EmptyValue by the way you need.

    EmptyValue means a ComboBox's value to consider as null, i.e. no value.

    If you need some default value, what about to load it from a handler as well, i.e. at the same time with other items. Then select this default value within a Store's Load listener.
    I've try this:
    I've just try to add 1 extra value each reload which contains emptytext and emptyValue inside returned json. Even though sometimes this Value isn't at firstplace from top.
    but this empty item isn't at the top of loaded items list. I've added it by insert on index 0 so it should be at the top in my guess.
  4. #4
    Please provide a simplified example to reproduce. We will try to help to get this item at the top.
  5. #5
  6. #6
    Thank you for the excellent sample.

    Setting RemoteSort to true for the Store should help.
  7. #7
    Quote Originally Posted by Daniil View Post
    Thank you for the excellent sample.

    Setting RemoteSort to true for the Store should help.
    Yes that's work great:)

    Thanks @Daniil:)

Similar Threads

  1. [CLOSED] Filter Remotely on Displayed Value
    By rbarr in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Mar 13, 2012, 3:46 PM
  2. combobox: how to select on empty?
    By danilo in forum 1.x Help
    Replies: 1
    Last Post: Jun 27, 2011, 7:50 AM
  3. Replies: 0
    Last Post: Jun 26, 2009, 11:32 AM
  4. Replies: 1
    Last Post: May 18, 2009, 1:41 PM

Tags for this Thread

Posting Permissions