PDA

View Full Version : different Ext js file for multiple grids?



tkm
30 Jan 2008, 2:20 AM
Hello Friends,
Do I need to have 1 Ext Js script for 1 data grid? I mean, say for another grid in a different page if I want to have datasource to be linked with another table/database do I have to create another .js file or that can be done from the same js file? Thank you.

bone
30 Jan 2008, 2:41 AM
Each page is a different "instance" and you can use the same ext-all.js. The point is that between pages its very hard/unusual/impossible(?) to share stuff via js-script. The page (browser) interprets the js-file once and dont care about any changes in the file untill the page is reloaded again. It is also impossible for PageA that is using ext.js to reach any of the objects created by PageB using the same ext.js.

I'm having problems understanding your question so I'll try to construct the question for you:

"Can I use the same Ext Js file to create grids on other pages that uses datastores that is connected to different datasources?" <- yes

"Can I use Grid-A on Page-A with Data-A and have Grid-A on Page-B using Data-B and not having two js-files?" <- yes, you should probably learn about Ext-ending classes tho.

"Please do my job" <- ask Animal ;) (just kidding, dont ask Animal)

tkm
30 Jan 2008, 3:04 AM
Each page is a different "instance" and you can use the same ext-all.js. The point is that between pages its very hard/unusual/impossible(?) to share stuff via js-script. The page (browser) interprets the js-file once and dont care about any changes in the file untill the page is reloaded again. It is also impossible for PageA that is using ext.js to reach any of the objects created by PageB using the same ext.js.

I'm having problems understanding your question so I'll try to construct the question for you:

"Can I use the same Ext Js file to create grids on other pages that uses datastores that is connected to different datasources?" <- yes

"Can I use Grid-A on Page-A with Data-A and have Grid-A on Page-B using Data-B and not having two js-files?" <- yes, you should probably learn about Ext-ending classes tho.

"Please do my job" <- ask Animal ;) (just kidding, dont ask Animal)

Thanks for the questions restructuring. So Ext-ending classes concept should help me onthis, right? which I need to learn first. The prob is finding any suitable tutorial on that or the right place to find.

bone
30 Jan 2008, 8:10 AM
Well, you would make it a lot more easy for me to tell if you need to extend classes or not if you told me what you wanted to do.

If you want two grids on two pages you do on the second page exactly what you did on the first, only changing what you want to change.

All in all I suspect you're not quite getting how javascript works, and in that case this forum is not the right place to fool around.

http://extjs.com/learn/
http://extjs.com/learn/Tutorials

tkm
30 Jan 2008, 8:21 AM
Well, you would make it a lot more easy for me to tell if you need to extend classes or not if you told me what you wanted to do.

If you want two grids on two pages you do on the second page exactly what you did on the first, only changing what you want to change.

All in all I suspect you're not quite getting how javascript works, and in that case this forum is not the right place to fool around.

http://extjs.com/learn/
http://extjs.com/learn/Tutorials
Mate I am not a Guru of Javascript but I am not bad at all. But yes, I am just 2/3 days old to Ext JS, thus some help from you or Animal would be really helpful. I can always have 2/multiple ext.js files for different grids. But what I am looking for is a template file in which I can pass the parameters of datasource name and column/field name for ColumnModeling in the Ext.js file. Or is that smthg I need to customise for my own requirement? Thank you.

I can always sort this