1. #1
    Sencha User
    Join Date
    Sep 2008
    Posts
    6
    Vote Rating
    0
    fakoua is on a distinguished road

      0  

    Default celldblclick does not fired if the cell contains HTML extjs 3.4.0

    I have the following EditorGridPanel on extJS:

    Code:
    Ext.onReady(function () {
      var myData = [[ '<SPAN STYLE=\"text-align:Left;font-family:Segoe UI;font-style:normal;font-weight:normal;font-size:12;color:#000000;\"><P STYLE=\"font-family:Arial;font-size:16;margin:0 0 0 0;\"><SPAN><SPAN>HTML </SPAN></SPAN><SPAN STYLE=\"font-weight:bold;color:#FF0000;\"><SPAN>FORMAT</SPAN></SPAN><SPAN><SPAN> TEST<BR />TEST</SPAN></SPAN></P></SPAN>', "lisa@simpsons.com", "555-111-1224"],
                    [ 'Bart', "bart@simpsons.com", "555-222-1234"],
                    [ 'Homer', "home@simpsons.com", "555-222-1244"],
                    [ 'Marge', "marge@simpsons.com", "555-222-1254"]];
    
    
      var store = new Ext.data.SimpleStore({
        fields:[ {
          name: 'name'
        },
        {
          name: 'email'
        },
        {
          name: 'phone'
        }],
        data: myData
      });
      var grid = new Ext.grid.EditorGridPanel({
        renderTo: 'grid-container',
        columns:[ {
          header: 'Name',
          dataIndex: 'name', 
            width:200
        }
        ],
        store: store,
        frame: true,
        height: 240,
        width: 500,
          enableColumnMove :false,
                stripeRows: true,
                enableHdMenu: false,
                border: true,
                autoScroll:true,
                clicksToEdit: true,
        title: 'HTML in Grid Cell',
        iconCls: 'icon-grid',
          sm: new Ext.grid.RowSelectionModel({
          singleSelect: true
        })
      });
    
    
        grid.on({
            celldblclick: function() {alert(1);}
            });
    });

    the problem is, when the gridCell contains HTML data (which is my situation) when you double click on the cell with html the grid does not fire the event celldblclick.
    in my application I need to display that kind of html in the grid.
    how can fix this problem? anyway to bubble the event from the html to the grid?
    Thanks

    Please try it from: http://jsfiddle.net/VDFsq/1/

  2. #2
    Sencha User
    Join Date
    Jan 2011
    Posts
    549
    Vote Rating
    54
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default

    I guess the real question should be, why are you putting HTML into your store in the first place? :/

  3. #3
    Sencha User
    Join Date
    Sep 2008
    Posts
    6
    Vote Rating
    0
    fakoua is on a distinguished road

      0  

    Default

    I need to dispaly HTML into my grid. that's why I put html into my store

  4. #4
    Sencha User
    Join Date
    Jan 2011
    Posts
    549
    Vote Rating
    54
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default

    Putting HTML into a store is not a normal method.

    It might be a better idea to explain what you're trying to achieve, as there must be a better way to do it...

  5. #5
    Sencha User
    Join Date
    Sep 2008
    Posts
    6
    Vote Rating
    0
    fakoua is on a distinguished road

      0  

    Default

    I'm trying to display HTML into the GridEditor Cell is there any better way? how can I display HTML into the GridEditorPanel.

  6. #6
    Sencha User
    Join Date
    Jan 2011
    Posts
    549
    Vote Rating
    54
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default

    You still haven't explained why though.

    Have you looked into column renderers in the API?

  7. #7
    Sencha User
    Join Date
    Sep 2008
    Posts
    6
    Vote Rating
    0
    fakoua is on a distinguished road

      0  

    Default

    Many thanks willigogs, I really apreciate your help.
    the renderer does not solve the problem, the problem is that the cell does not fire the double click when it contains HTML tags, I've update the script to use rendere please try to click on the red html data.
    http://jsfiddle.net/VDFsq/10/

  8. #8
    Sencha User
    Join Date
    Jan 2011
    Posts
    549
    Vote Rating
    54
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default

    And once again, why are you putting HTML into the store?

    What requirement have you been given that has lead you to even attempt this?

    I see no reason why you would ever need to (since you can achieve the exact same with a renderer), therefore why not simply leave your data as it was originally without the surrounding HTML code (as I expect it is this which is breaking any logic)?

    I assume you have no cellclick issue if you remove the HTML?

  9. #9
    Sencha User
    Join Date
    Sep 2008
    Posts
    6
    Vote Rating
    0
    fakoua is on a distinguished road

      0  

    Default

    Dear willigogs,
    I use HTML because the client wants to display HTML in the gird, and regarding the rendere, In the latest script I use renderer and does not solve the problem.
    Thanks

Thread Participants: 1

Tags for this Thread