Problems with ComboBox Two Columns

  1. #1

    Problems with ComboBox Two Columns

    I have a problem when using a combobox two columns.
    When you select an item, the combobox is filled with the 1st item and not what I selected


    Following is the code:
    <ext:ComboBox ID="cbTurmaDisciplina" runat="server" EmptyText="Selecione a Turma..." TypeAhead="true" ForceSelection="true" Mode="Local" DisplayField="dcturma" ValueField="iddisciplina" MinChars="1" ListWidth="300" PageSize="10" ItemSelector="tr.list-item" BlankText="Escolha uma opção" AllowBlank="false"> <Store> <ext:Store runat="server" ID="TurmaDisciplinaStore"> <Reader> <ext:JsonReader> <Fields> <ext:RecordField Name="iddisciplina" ServerMapping="Disciplina.Iddisciplina" /> <ext:RecordField Name="dcdisciplina" ServerMapping="Disciplina.Dcdisciplina" /> <ext:RecordField Name="dcturma" ServerMapping="Turma.Dcturma" /> </Fields> </ext:JsonReader> </Reader> </ext:Store> </Store> <Template ID="Template1" runat="server"> <Html> <tpl for="."> <tpl if="[xindex] == 1"> <table class="cbTurmas-list"> <tr> <th>Turma</th> <th>Disciplina</th> </tr> </tpl> <tr class="list-item"> <td style="padding:3px 0px;">{dcturma}</td> <td>{dcdisciplina}</td> </tr> <tpl if="[xcount-xindex]==0"> </table> </tpl> </tpl> </Html> </Template> <Triggers> <ext:FieldTrigger Icon="Clear" HideTrigger="true" /> </Triggers> <Listeners> <BeforeQuery Handler="this.triggers[0][ this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" /> <TriggerClick Handler="if (index == 0) { this.focus().clearValue(); trigger.hide();}" /> <Select Handler="this.triggers[0].show();" /> </Listeners> </ext:ComboBox>
    CODE-BEHIND:
    protected void Page_Load(object sender, EventArgs e) { if (!X.IsAjaxRequest) { } DcplLecionadas dcpl_lecionada = new DcplLecionadas(); DcplLecionadasBO dcpl_lecionada_bo = new DcplLecionadasBO(); dcpl_lecionada.Professor = new Professores(); dcpl_lecionada.Professor.Idprofessor = 43; //Convert.ToInt32(Session["idorigem"]); List<DcplLecionadas> list = new List<DcplLecionadas>(); list = dcpl_lecionada_bo.fillComboBoxTurmaDisciplina(dcpl_lecionada.Professor); TurmaDisciplinaStore.DataSource = list; TurmaDisciplinaStore.DataBind(); }
    When debugging I see that the datasource is no problem, the problem only occurs when I select, but is displaying the values ​​correctly.

    thank you
    Last edited by Daniil; Jan 19, 2012 at 12:29 PM. Reason: Please use [CODE] tags
  2. #2
    I was able to identify the problem and realized that you can not do what I'm doing the way he needed a way to get the values ​​of the selected line item

    This is possible?
  3. #3
    Hi,

    Please clarify is there the same problem, isn't that so?
    http://forums.ext.net/showthread.php?16984

Similar Threads

  1. Help with Combobox Two Columns
    By abelvn in forum 1.x Help
    Replies: 4
    Last Post: Oct 20, 2011, 4:53 PM
  2. [CLOSED] Problems hiding/showing TreeGrid columns
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Sep 13, 2011, 9:24 PM
  3. Problems with linked combobox/superboxselect
    By wilbur60 in forum 1.x Help
    Replies: 0
    Last Post: Feb 25, 2011, 8:34 PM
  4. About Two Columns in combobox...
    By CasualXX in forum 1.x Help
    Replies: 4
    Last Post: Jun 11, 2010, 6:00 AM
  5. [CLOSED] [1.0] Problems with CompositeField and ComboBox
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 15, 2010, 4:04 AM

Posting Permissions