Reputation: 494
What is the Ext JS equivalent of jQuery's $('#content').load('foo.html #partOfPage');?
The generic Sencha ajax call is naturally more verbose, but just as easy:
Ext.Ajax.request({
url: 'foo.html',
success: function(response, opts) {
Ext.getCmp('content').update(response.responseText);
}
});
How would add a way to that so I can parse for a single ID?
pls, no lectures on 'why are you lazy loading?'... ect.
Thanks,
Joel
Upvotes: 0
Views: 373
Reputation: 14447
Out of the box it isn't possible as far as i know but you could create your own workaround by passing the whole responseText HTML blob into Ext.DomHelper.createDom()
to generate DOM-nodes from the response without actually adding them to the page and then looking through the created nodes to find the node you are looking for.
From there on it's just getting the innerHTML and passing that into your update function
Upvotes: 2