javascript - Extjs - Combo with autocomplete: two types of values -
i'm trying add new criteria extjs combo autocomplete. when user enters term in text field, should suggestions, either student's name, or subject. did accomplish first case (names only). here details: extjs - combo templates display multiple values
now, should add subject criteria in autocomplete list, if user enters mat, get:
mathio,jay << student's first , last name
mark,matt << student's first , last name
mathematics << subject
here code, still not working:
listconfig: { loadingtext: 'loading...', tpl: ext.create('ext.xtemplate', '<tpl for=".">', '<tpl if="subject.length != 0"> ', '<div class="x-boundlist-item">{subject}</div>', '<tpl if="l_name.length == 0"> ', '<div class="x-boundlist-item">{f_name}<p><font size="1">last name: unknown </font></p></div>', '<tpl else>', '<div class="x-boundlist-item">{f_name}<p><font size="1">{l_name}</font></p></div>', </p></div>', '</tpl>', '</tpl>'), renderto: ext.getbody(), },
seems if..else construction inside template definition wrong,
tpl: ext.create('ext.xtemplate', '<tpl for=".">', '<tpl if="subject.length != 0"> ', '<div class="x-boundlist-item">{subject}</div>', '<tpl else>', '<tpl if="l_name.length == 0"> ', '<div class="x-boundlist-item">{f_name}<p><font size="1">last name: unknown </font></p></div>', '<tpl else>', '<div class="x-boundlist-item">{f_name}<p><font size="1">{l_name}</font></p></div>', '</tpl>', '</tpl>', '</tpl>'),
Comments
Post a Comment