Joel Crawford-Smith
Joel Crawford-Smith

Reputation: 494

Ext JS equivalent

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

Answers (2)

ChrisR
ChrisR

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

Johnathan Hebert
Johnathan Hebert

Reputation: 661

Try this:

Ext.get('content').load('foo.html');

Upvotes: 0

Related Questions