[CLOSED] Combobox selection and gridpanel model

  1. #1

    [CLOSED] Combobox selection and gridpanel model

    Hi,

    I'm using ext.net 3.1.

    I have one gridpanel and one combobox in my page.

    Here my requirement is when ever item got selected in combobox then gridpanel should be updated based on the selected value.

    Now, while page load intially the gridpanel renders the default data perfectly...Grid panel loads the data but model and gridheaders are not updated but data and page size updated properly when ever I try to change the value in combobox .

    Here is my problem because of header/model but data is not displaying properly.

    Im using combobox select directevent...

    I guess store or model is not clearing properly.

    I tried as below:

    Store1.Model.clear();
    
    Gridpanel1.getstore().Model.clear();
    
    GridPanel1.ColumnModel.Columns.clear();
    but nothing happens.


    Please help me on this.

    Thanks,
    Vamsi.
    Last edited by Daniil; Aug 09, 2015 at 12:08 PM. Reason: [CLOSED]
  2. #2
    Hi Vamsi

    Could you please provide a sample to reproduce the issue? I don't think what you're looking for is clearing the Model. There could be a mismatch somewhere on the Direct Event from the ComboBox's click, since the GridPanel is loading correctly on Page Load.

    A sample could help discover where the problem is.
  3. #3
  4. #4
    Hi,

    I tried to use reconfigure its working as expected but when I tried to edit its throwing java script exception.

    Please help me on this, if any other option available..

    Thanks,
    Vamsi.
  5. #5
    Please provide a test case.
  6. #6
    Hi,

    Now I'm able to render the data along with columns header when data source changes, but there was an issue when inserting the records.

    After changing the datasource, I tried to update the row using direct event below

    
     Store1.Model.Clear();
                
                model1.Fields.Clear();
                GridPanel1.ColumnModel.Columns.Clear();
                GridPanel1.SelectionModel.Clear();
    
               GridPanel1.Update();
                            SelectedColumns = dt1.DefaultView.ToTable(false, SelectedColumnsList.ToArray());
                            Store1.DataSource = SelectedColumns;
                            Store1.DataBind();
    
    
    
    <ext:RowEditing ID="RowEditing1" runat="server">
                                    <%--   <Listeners>
                                            <CancelEdit Fn="CancelEdition" />
                                        </Listeners>--%>
                                    <DirectEvents>
                                        <Edit OnEvent="btnUpdateRow_Click" ViewStateMode="Enabled">                                       
                                            <ExtraParams>
                                                <ext:Parameter Name="InsertedValues" Value="Ext.encode(#{GridPanel1}.getRowsValues({selectedOnly : true}))"
                                                    Mode="Raw" />
                                                <ext:Parameter Name="ModifiedValues" Value="Ext.encode(#{GridPanel1}.getRowsValues({dirtyRowsOnly : true}))"
                                                    Mode="Raw" />
                                            </ExtraParams>
                                        </Edit>
                                        <CancelEdit OnEvent="btnCancelRow_Click" ViewStateMode="Enabled">
                                        </CancelEdit>
                                    </DirectEvents>
    But when I see the value in extra-param then only match the records with initial data source at the time of page load and current datasource.

    For exmaples : I have One User datasource, finance data source and soon...

    If I will switch user datasource to finance datasource or other datasource.

    UserName Column is available in all the datasources , so only userName is available in extra-param.

    if again I switch back to original datasource at the time of paegload then It will give me selected data properly as expected, other I will switch any other datasource it is giving back only matched records.

    I guess client side is not updated properly with new model(some where caching)

    Please guide me how we can overcome with this issue.
    Last edited by Daniil; Jul 24, 2015 at 3:45 PM.
  7. #7
    Sorry, that is difficult to say what is going wrong. Please provide a full test case.

Similar Threads

  1. Replies: 2
    Last Post: Apr 21, 2014, 8:24 AM
  2. Replies: 1
    Last Post: Dec 04, 2013, 10:53 AM
  3. Some question about GridPanel Selection Model
    By gary16 in forum 1.x Help
    Replies: 4
    Last Post: Apr 10, 2013, 1:33 PM
  4. Replies: 3
    Last Post: Oct 05, 2012, 11:44 AM
  5. [CLOSED] Gridpanel selection model
    By drgw74 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 14, 2009, 9:52 AM

Posting Permissions