Results 1 to 4 of 4

Thread: Integrating Ext.form.ComboBox w/ Existing AJAX call & Changing Ext.Window items

  1. #1
    Sencha User
    Join Date
    Oct 2011
    Location
    Dallas/Fort Worth
    Posts
    43

    Default Answered: Integrating Ext.form.ComboBox w/ Existing AJAX call & Changing Ext.Window items

    Hi,

    I'm still looking through the forums, but not found quite what I need. This is probably trivial ?

    1. An Ext.form.ComboBox on a tbar inside an Ext.Window needs to be populated with items using an existing javascript routine that does the AJAX call and returns JSON.

    2. I need to switch out the items in the Ext.Window. (Update a Chart using the JSON data).


    All I'm finding so far is using JsonStore's and not sure if the myWindow.add(myItems) is going to do the trick?

    Thanks.
    It's just one's and zero's, what could go wrong?

  2. You can't avoid using a store: a combobox has a store no matter what.

    However...

    The store doesn't have to do the Ajax request. Given what you've described I'd say the easiest way to do it is to create an empty store for your combobox and just load the data in once you have it.

    Some docs that might prove helpful:

    http://docs.sencha.com/ext-js/4-0/#!...ore-method-add
    http://docs.sencha.com/ext-js/4-0/#!...ethod-loadData
    http://docs.sencha.com/ext-js/4-0/#!...od-loadRawData

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    So all you have to do is remove and add items.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  4. #3
    Sencha User
    Join Date
    Oct 2011
    Location
    Dallas/Fort Worth
    Posts
    43

    Default

    Perhaps I should be more clear.

    - I need to take JSON data and load it into the combo box (a) after I've already rendered an Ext.Window (with the combo box in the tbar) (b) without using a Sencha store (I have to use an existing javascript method doing an AJAX call returning JSON).

    I see the update method on Ext.form.ComboBox, but still looking for an example.
    It's just one's and zero's, what could go wrong?

  5. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791
    Answers
    585

    Default

    You can't avoid using a store: a combobox has a store no matter what.

    However...

    The store doesn't have to do the Ajax request. Given what you've described I'd say the easiest way to do it is to create an empty store for your combobox and just load the data in once you have it.

    Some docs that might prove helpful:

    http://docs.sencha.com/ext-js/4-0/#!...ore-method-add
    http://docs.sencha.com/ext-js/4-0/#!...ethod-loadData
    http://docs.sencha.com/ext-js/4-0/#!...od-loadRawData

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •