Multicombo show different field(s)

  1. #1

    Multicombo show different field(s)

    Not an isue, but an alternative for others which are looking for such option:
    The idea is to show something like ShortName(LongName) in picker list, but to display only ShortName in edit field.

    I wanted to avoid functions overwrite or too much javascript.

    On short, add the below row in Show listener (ShortName have to be set as DisplayField in this example):
    <Show Handler="var pick=this.getPicker(); var xhtml=this.picker.tpl.html; this.picker.tpl.html=xhtml.replace('{ShortName}','{ShortName}({LongName})');" />
    Of course, ShortName/LongName have to be valid record fields.
    The default this.picker.tpl.html is the folowing:
    <ul><tpl for="."><li role="option" class="x-boundlist-item"><div class="x-combo-list-item {[this.getItemClass(values)]}"><div class="x-mcombo-text">{displayField}</div></div></li></tpl></ul>
    so, you can play with html a bit.


    Didn't find breaks in functionality until now.
    Last edited by Daniil; Oct 08, 2012 at 8:28 AM. Reason: Please use [CODE] tags
  2. #2
    Hi @watteeuw,

    Thank you for sharing! Looks very good.

    Moved to the Examples and Extras forum.

    We will look into a possibility to configure an inner template.

    By the way, here is an example how to incorporate icons into the template.
    http://forums.ext.net/showthread.php...ll=1#post92433
  3. #3
    Hi @watteeuw,

    Now it is possible to set up the ListConfig.ItemTpl property. Here are more details.
    http://forums.ext.net/showthread.php...ll=1#post98715

Similar Threads

  1. Replies: 3
    Last Post: Dec 29, 2012, 6:15 AM
  2. Replies: 2
    Last Post: Jan 18, 2012, 5:24 PM
  3. [CLOSED] TextField does not show the red borders for a required field.
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Mar 16, 2010, 12:03 PM
  4. Show Field from ID in ComboBox Editor
    By Cliff in forum 1.x Help
    Replies: 0
    Last Post: Feb 17, 2010, 6:47 PM
  5. [CLOSED] Field Labels don't show
    By gokcemutlu in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jul 15, 2009, 9:18 AM

Posting Permissions