PDA

View Full Version : How to show Data



waqasaslammmeo
20 Feb 2012, 11:13 PM
hello every one !
i am very new in this . now i am able to get data from mssql server 2008 but prob is that i want to show all data in grid . i read code of examples of grid present in this site . all data is pre define in code . like in this way
var myData = [
{ name: "Record 0" , column1: "0" , column2: "0"},
{ name: "Record 1", column1: "1", column2: "1"},
{ name: "Record 2", column1: "2", column2: "2" }
]
now how to show my data here :( , someone tell me that i have to use store.load() in order to show my data in grid , but i dont know how to use it . please any one help me to perform this :( and if someone give me some hints or code i will be very thank full to him .(i am using Asp.net with c# .)

Best Regards

M.Waqas Aslam

mitchellsimoens
21 Feb 2012, 6:41 AM
There are some grid examples that use remote data. For example: http://docs.sencha.com/ext-js/4-0/#!/example/grid/paging.html

waqasaslammmeo
22 Feb 2012, 12:09 AM
Thanks for you interest in my prob , well i already read all of them more then once ,i need some step by step guide . please help me in this , now it become very annoying to me , there is not a single forum i found on net where i can ask my questions about ext js4 and they reply it , in this forum , 0.1% people help others . please if you have some information about any forum and community , please do tel me , :( and if possible then please tell me how to retrieve my data from webservice and show it in Ext.Grid, how to make store and where to call it .

any help will be greatly appreciated.

Best regards

mitchellsimoens
22 Feb 2012, 5:12 AM
Thanks for you interest in my prob , well i already read all of them more then once ,i need some step by step guide . please help me in this , now it become very annoying to me , there is not a single forum i found on net where i can ask my questions about ext js4 and they reply it , in this forum , 0.1% people help others . please if you have some information about any forum and community , please do tel me , :( and if possible then please tell me how to retrieve my data from webservice and show it in Ext.Grid, how to make store and where to call it .

any help will be greatly appreciated.

Best regards

I average 150 posts a day so this forum is active as far as I am concerned. You did post in the incorrect forum, we have an Ext JS 4 Q&A forum where this should have been posted and I will move it there.

To resolve remote data, you have to use a proxy to send the server call and a reader to read the response. Those two depend on the response. For example, take a look at this store:


new Ext.data.Store({
model : 'SomeModel',
proxy : {
type : 'ajax',
url : 'someurl',
reader : {
type : 'json',
root : 'data;
}
}
});

That store would take in a response like:


{
"succes" : true,
"total" : 100,
"data" : [
....
]
}

In the proxy config, we are using an Ajax proxy loading from someurl. In the reader config, we are using a Json reader, the successProperty defaults to success, the totalProperty defaults to total but root doesn't have a default but we have data which will be the root property to get your records.