Question

List Template:

var templ = new Ext.XTemplate(
      '<tpl if="isActive">',
            '<div style="color:red" class="',
            Ext.baseCSSPrefix + 'list-sortablehandle',
            '">',
        '</tpl>',    
    '<b>Name: {text}</b>',
        '<tpl if="isActive">',
            '<b>{text}</b></div>',
        '</tpl>',
            {
                // XTemplate configuration:
                compiled: true,
                // member functions:
                isitem2: function (name) {
                    return name == 'item2';
                },
            }
);

I can able to get the list item from specific index using

var targetItem = list.getItemAt(targetIndex);

but

targetItem.down('.x-list-sortablehandle')

through expection

Object [object Object] has no method 'down'

I want to know whether the specific element in present inside the listmItem

Was it helpful?

Solution

getItemAt is probably returning a SimpleListItem (assuming you aren't setting anything custom), which does not have a down method. What you probably want to do is grab the element from that, so instead of targetItem.down try using targetItem.element.down.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top