[CLOSED] Multiple selection models inside a grid panel.

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Multiple selection models inside a grid panel.

    Hi, Pls look at the image below for the problem.

    Click image for larger version. 

Name:	multipleSelectionModels.png 
Views:	129 
Size:	94.7 KB 
ID:	23934
    Last edited by Daniil; Apr 30, 2015 at 3:06 PM. Reason: [CLOSED]
  2. #2
    Hi @arjunrvasisht,

    You can try to use a GridPanel's ItemClick event.
    http://docs.sencha.com/extjs/4.2.1/#...vent-itemclick
  3. #3
    Thanks Daniil, I could use the itemclick event. But as shown in the image I have few rows disabled. And the event fires for disabled rows also.
    How do I restrict the item click event from firing for disabled rows.
  4. #4
    How do I restrict the item click event from firing for disabled rows.
    It might be problematic to restrict.

    I would recommend other approach - ignore the ItemClick handler if a row is disabled.
  5. #5
    Ok But How do I ignore it. Can u pls share me a piece of code.
  6. #6
    Like this:

    var onItemClick = function() {
        if ("not disabled") {
           // All the logic required for a non-disabled row goes here.
        }
    };
  7. #7
    Daniil,
    The logic you are proposing is fine but my question is how do I check if it is enabled or disabled.
  8. #8
    Ok, how do you disable a row? The way how you disable it is probably a tip how to check it is disabled or not.
  9. #9
    Well, I have 2 render functions written for disabling. I have two columns in a grid. And i am disabling both in the respective render functions like below: 'disableTier2Name' and 'disableTier2DisplayName' are the two render functions am using to disable.

    <ColumnModel ID="ColumnModel1">
                                        <Columns>
                                            <ext:Column ID="Column1" runat="server" DataIndex="Name" Text="Tier2" Width="270" Hideable="false">
                                                <Renderer Fn="disableTier2Name" />
                                            </ext:Column>
                                            <ext:ComponentColumn ID="ComponentColumn2" Namespace="App" runat="server" Editor="true"                       DataIndex="DisplayName" Width="270" Text="Name As On Metric Upload File" Align="Center">
                                               
    
                                                <Component>
                                                    <ext:TextField ID="TextField2" runat="server" Namespace="App">
                                                        <Listeners>
                                                            <Render Fn="disableTier2DisplayName"></Render>
                                                        </Listeners>
                                                    </ext:TextField>
    
                                                </Component>
                                              
                                            </ext:ComponentColumn>
                                        </Columns>
                                    </ColumnModel>

     function disableTier2Name(columnValue, columnValueCSS, record, rowIndex) {  
                //   debugger;
                if(record.data.IsInUse == 0)
                {
                    columnValueCSS.css = "disAssociatedColor";
                }           
                return columnValue;
            }
      function disableTier2DisplayName(field,columnValueCSS) {  
                //   debugger;
                var abc = this;
                if(field.record.data.IsInUse == 0)
                {
                    abc.disable();
                }
               
            }
  10. #10
    So, you can check a row on disabled just by examining
    record.data.IsInUse
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 6
    Last Post: Jun 30, 2014, 5:51 PM
  2. [CLOSED] Multiple Row Selection Grid Panel with out ctrl key
    By WHISHWORKS in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 15, 2013, 10:10 AM
  3. [CLOSED] Multi-Select Tree and Selection Models
    By PhilG in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 12, 2012, 9:50 AM
  4. [CLOSED] dynamic selection models
    By GLD in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 02, 2011, 11:14 AM
  5. Multiple Row Selection Grid Panel with out ctrl key
    By AnandVishnu in forum 1.x Help
    Replies: 2
    Last Post: Oct 03, 2011, 10:08 AM

Tags for this Thread

Posting Permissions