[CLOSED] Best Way to Extend a ComboBox inherited Control

  1. #1

    [CLOSED] Best Way to Extend a ComboBox inherited Control

    Good Afternoon all

    I wrote my first ComboBox implementation. The function is quite simple, enter a ZIP code and display the Zip Code formatted as '{ZIP} - {CITY}'.
    Works fine so far. The Search looks link your Example http://examples2.ext.net/#/Form/ComboBox/Custom_Search/.

    Now my problem.

    -> I want to set the Value 'ZIP' and call the Service to grab the CITY from the Database. This Function must be available from Code Behind and also from JS.

    I await this things to be done after calling the Method :

    • The displayed Text should look as described above.
    • The Value of the ComboBox should set to a value I receive from my Service Method (basically the RecordID of the City found in the DB)


    What's the best approach to solve this Problem, what do you think ?

    Peter
    Last edited by Daniil; Apr 16, 2013 at 6:35 AM. Reason: [CLOSED]
  2. #2
    Hi Peter,

    I would implement a JavaScript function like:
    function setZip (zip) {
        var comboBox = this; // the setZip function belongs to a custom ComboBox class
        
        comboBox.getStore().load({
            params: {
                zip: zip // you should take it into account in a WebService to return respective data
            },
            callback: function () {
                comboBox.setValue(zip);
            }
        })
    }
    Then you can implement a method for a server ComboBox class to invoke the setZip method.

Similar Threads

  1. [CLOSED] Extend StoreResult
    By RCM in forum 2.x Premium Help
    Replies: 1
    Last Post: Mar 11, 2013, 9:36 AM
  2. Replies: 8
    Last Post: Sep 21, 2012, 11:11 AM
  3. [CLOSED] Register javascript resource to inherited control
    By Pablo_Azevedo in forum 1.x Premium Help
    Replies: 2
    Last Post: Nov 11, 2010, 9:24 PM
  4. [CLOSED] How to extend Ext.NET components
    By pil0t in forum 1.x Premium Help
    Replies: 1
    Last Post: Apr 26, 2010, 5:46 PM
  5. Replies: 3
    Last Post: Oct 07, 2009, 7:32 PM

Posting Permissions