Generate a new Ext.data.GroupingStore
Examples:
var store = new Ext.data.GroupingStore({
reader: new Ext.data.JsonReader({
id:'id',
totalProperty:'count', root:'results',
fields:[{
name: "accounts.name"
},{
name: "accounts.categories.name"
},{
type: "date",
renderer: Ext.util.Format.dateRenderer(),
name: "accounts.date",
dateFormat: "c"
},{
type: "date",
renderer: Ext.util.Format.dateTimeRenderer(),
name: "accounts.datetime",
dateFormat: "c"
} ]}),
proxy: new Ext.data.HttpProxy({ url:'/backend/accounts.json' }),
remoteSort: true
});
grid.store do |store|
store.url "/backend/accounts.json"
store.add "accounts.name"
store.add "accounts.categories.name"
store.add "accounts.date", :type => :date
store.add "accounts.datetime", :type => :datetime
end
Methods
Public Instance methods
This add automatically fields from an array
[ show source ]
# File lib/view/helpers/ext/store.rb, line 54
54: def fields(fields)
55: fields.each { |options| add_field(nil, options) }
56: end
Return the javascript for create a new Ext.data.GroupingStore
[ show source ]
# File lib/view/helpers/ext/store.rb, line 83
83: def to_s
84: raise ComponentError, "You must provide the correct var the store." if get_var.blank?
85: raise ComponentError, "You must provide the url for get the store data." if @url.blank? && config[:proxy].blank?
86: raise ComponentError, "You must provide some fields for get build store." if @fields.blank?
87: config[:proxy] = default_proxy if config[:proxy].blank?
88: config[:reader] = default_reader if config[:reader].blank?
89: super
90: end
The url for getting the json data
[ show source ]
# File lib/view/helpers/ext/store.rb, line 49
49: def url(value)
50: @url = value
51: end