1. #1
    Ext User Perfect Lion's Avatar
    Join Date
    Aug 2007
    Location
    Brazil
    Posts
    79
    Vote Rating
    0
    Perfect Lion is on a distinguished road

      0  

    Default Insert item comboBox

    Insert item comboBox


    Hi,
    comboBox plus some would like to be able to add in mine store for one itens in the hand. how I would make this?

    Code:
    var storeArea = new Ext.data.Store({
    								// HttpProxy should be used here
    								proxy: new Ext.data.HttpProxy({
    									url: 'rel_sla_fsp.php?action=SlaFspComboJson&comboType=Area'
    								}),
    								
    								reader: new Ext.data.JsonReader({
    									root: 'conteudo',
    									totalProperty: 'total',
    									id: 'id'
    									
    								}, [
    									{name: 'area'}
    								])
    								
    							});
    							
    							var TopicRecord = Ext.data.Record.create(
    							    {name: 'area'}
    							);
    							
    							var myNewRecord = new TopicRecord({
    							    area: 'ALL'
    							});
    							
    							storeArea.add(myNewRecord);
    							
    							storeArea.load();

  2. #2
    Sencha User catacaustic's Avatar
    Join Date
    Jul 2007
    Location
    "A Land Down Under"
    Posts
    618
    Vote Rating
    1
    catacaustic is on a distinguished road

      0  

    Default


    The first problem that you've got is that you're adding the new record BEFORE you load the data store. By doing this you're only overwriting what's in the store now, so you'll always be throwing away the record that you just entered.

    In your situation, I'd say the best solution would be to set up the back-end script to send back that value with the rest as part of the standard response. That way you don't need to add in anything when it gets back.

    If you REALLY need to add it after retrieving the data records then add it to the store with some sort of ID that's lower then the rest. That way it should be on the top of the list as long as the sorting is right (Store's can sort themselves using the sort () method).
    'Once again, fortune vomits on my eiderdown'
    - Edmund Blackadder

  3. #3
    Sencha User fay's Avatar
    Join Date
    Apr 2007
    Location
    Ireland
    Posts
    1,750
    Vote Rating
    7
    fay will become famous soon enough fay will become famous soon enough

      0  

    Default


    PHP Code:
    storeArea.on('load', function(storerecordsoptions)
    {
      
    storeArea.insert(0, new Ext.data.Record({/* fields */}));        
    }, 
    this); 

  4. #4
    Sencha User catacaustic's Avatar
    Join Date
    Jul 2007
    Location
    "A Land Down Under"
    Posts
    618
    Vote Rating
    1
    catacaustic is on a distinguished road

      0  

    Default


    I do feel taken back... The insert () method was one that I hadn't seen before. Fay is totally right there.

    And, I think I might just go hide in the corner somewhere.
    'Once again, fortune vomits on my eiderdown'
    - Edmund Blackadder

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar