JavaScript ExtJS 4.2 - have a remote-loading store that appends records rather than replaces them?

I have a store which I want to hardcode some initial values into. Then when it loads from the server I want it to APPEND the results to the initial values, rather than replacing them. Is this possible?

This is what I have at the moment:

var myStore = Ext.create("Ext.data.Store",{
  autoLoad: true,
  fields:[
    {name:"id", type:"int"},
    {name:"username", type:"string"}
  ],
  data: [
    {id: 1, name: "User1"},
    {id: 2, name: "User2"}
  ],
  proxy: {
    type: 'ajax',
    url: 'users.php?method=getUsers',
    reader: {
      type: 'json',
      root: 'results'
    }
  }
});

I want the data that gets returned from the PHP script to be added to the "User1" and "User2" already in the store.

Answer:1

Try this one:

store.load({
    addRecords: true
})
Answer:2

Here's what I'm after. When user clicks 'X' to close the IE 10 browser. Do the following: Trap the onbeforeunload event in javascript Make an ajax call to a server resource (a servlet) which has some ...

Here's what I'm after. When user clicks 'X' to close the IE 10 browser. Do the following: Trap the onbeforeunload event in javascript Make an ajax call to a server resource (a servlet) which has some ...

  1. onbeforeunload server side
  2. onbeforeunload call server side

Currently I am writing my own BBCode parser. More specifically I am working on the links. You can click on the link button, and it will insert a link (HTML <a>) around your text. Then that text ...

Currently I am writing my own BBCode parser. More specifically I am working on the links. You can click on the link button, and it will insert a link (HTML <a>) around your text. Then that text ...

  1. regex grab url
  2. regex extract urls
  3. regex extract urls from text
  4. regex extract urls from html
  5. regex extract url from string
  6. regex extract url path
  7. regex extract url parameters
  8. regex extract url from href
  9. regex extract url parts
  10. regex extract url domain

i tried to get the image src with jquery here is the code below jQuery("img").click(function() { var im = $(this).attr('src'); alert(im); return false; }); above working fine i can get ...

i tried to get the image src with jquery here is the code below jQuery("img").click(function() { var im = $(this).attr('src'); alert(im); return false; }); above working fine i can get ...

  1. get href value of anchor tag in jquery
  2. get href value of anchor tag in javascript
  3. get href value from anchor jquery
  4. how to get href value of anchor tag in jquery
  5. how to get href of anchor tag in jquery
  6. get href of anchor tag in jquery

I am trying to move an image (its a picture of a map) inside its container so a specific part of the image(a city) is in the center of its container when a div is clicked. I have this working but the ...

I am trying to move an image (its a picture of a map) inside its container so a specific part of the image(a city) is in the center of its container when a div is clicked. I have this working but the ...

  1. jquery animate left position
  2. jquery animate left to right
  3. jquery animate left to right slide example
  4. jquery animate left not working
  5. jquery animate left percentage
  6. jquery animate left
  7. jquery animate left to right slide
  8. jquery animate left to right loop
  9. jquery animate left slide
  10. jquery animate left toggle
  11. jquery animate left doesn't work
  12. jquery animate left to right toggle
  13. jquery animate left to right continuous
  14. jquery animate left auto
  15. jquery animate left 100
  16. jquery animate left right up down
  17. jquery animate left margin
  18. jquery animate left to right infinite
  19. jquery animate left position change
  20. jquery animate left fadeout