PDA

View Full Version : How can i render content of another js file to window



Czapla
9 Feb 2010, 12:24 AM
Hello

Basicly i have 2 files:
show_items_list.js
add_item.js

First generating a grid with list of all my items. On toolbar i have an add button. After click
a new modal window is display. Now i want to pass all of content from add_item.js file to my show_items_list.js window. Should i use render html function and inlcude file via <script type="javascript"> or is it another option?.
Or maybe should i merge the files?. But that give me 300+ lines of code. Debugging will be hard.

Basic code:
Her is my handler


tbar: new Ext.Toolbar({
items: [{
xtype: 'tbbutton',
text: 'add',
handler: function() {
modal_window_with_add_js_content.show();
}
}]


here is my modal window


var modal_window_with_add_js_content = new Ext.Window({
title: 'Include add_item.js to window',
frame: true,
width: 600,
height: 600,
modal: true,
closeAction:'hide',
layout:'fit',
plain: true
});


Cheers