[CLOSED] Tooltip doesn't work with CellEditing plugin

  1. #1

    [CLOSED] Tooltip doesn't work with CellEditing plugin

    Hi,
    see my example, if I add a tooltip into a grid that have a cellediting plugin the toolTip.triggerElement is null.
    Please hlep me.
    Thank you

    Jimmy

    <%@ Page Language="C#" %>
    
    
    <!DOCTYPE html>
    
    
    <html>
    <head runat="server">
        <title>Cell Editing - Ext.NET Examples</title>
        <link href="/resources/css/examples.css" rel="stylesheet" />
    
    
        <script>
            var addPlant = function (btn) {
                // Create a model instance
                var r = Ext.create('Plant', {
                    common: 'New Plant 1',
                    light: 'Mostly Shady',
                    price: 0,
                    availability: Ext.Date.clearTime(new Date()),
                    indoor: false
                }),
                    grid = btn.up("gridpanel");
    
    
                grid.store.insert(0, r);
                Ext.Function.defer(function () {
                    grid.editingPlugin.startEditByPosition({ row: 0, column: 0 });
                }, 100);
            }
    
    
            var onShowTtGridPlants = function (toolTip, grid) {
    
    
                debugger;
    
    
                var view = grid.getView(),
                   store = grid.getStore(),
                  record = view.getRecord(view.findItemByChild(toolTip.triggerElement)),
                  column = view.getHeaderByCell(toolTip.triggerElement);
                var data;
    
    
               data = record.get(column.dataIndex);
    
    
                toolTip.update(data);
            }
        </script>
    </head>
    <body>
        <ext:ResourceManager runat="server" >
            <Listeners>
                <DocumentReady Handler="App.ttGridPlants.setTarget(App.gridPlants.getView().getEl());" />
            </Listeners>
        </ext:ResourceManager>
    
    
        <ext:GridPanel
            ID="gridPlants" IDMode="Static"
            runat="server"
            Width="600"
            Height="300"
            Title="Edit Plants?"
            Frame="true">
            <Store>
                <ext:Store runat="server">
                    <Proxy>
                        <ext:AjaxProxy runat="server" Url="/Plants.xml">
                            <Reader>
                                <ext:XmlReader Record="plant" />
                            </Reader>
                        </ext:AjaxProxy>
                    </Proxy>
                    <Model>
                        <ext:Model runat="server" Name="Plant">
                            <Fields>
                                <ext:ModelField Name="common" Type="String" />
                                <ext:ModelField Name="botanical" Type="String" />
                                <ext:ModelField Name="light" />
                                <ext:ModelField Name="price" Type="Float" />
                                <ext:ModelField Name="availability" Type="Date" DateFormat="MM/dd/yyyy" />
                                <ext:ModelField Name="indoor" Type="Boolean" />
                            </Fields>
                        </ext:Model>
                    </Model>
                    <Listeners>
                        <Load Handler="Ext.Msg.show({
                                            title: 'Store Load Callback',
                                            msg: 'store was loaded, data available for processing',
                                            modal: false,
                                            icon: Ext.Msg.INFO,
                                            buttons: Ext.Msg.OK
                                        });"
                            Single="true" />
                    </Listeners>
                </ext:Store>
            </Store>
            <TopBar>
                <ext:Toolbar runat="server">
                    <Items>
                        <ext:Button runat="server" Text="Add Plant" Handler="addPlant" />
                    </Items>
                </ext:Toolbar>
            </TopBar>
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column
                        runat="server"
                        Text="Common Name"
                        DataIndex="common"
                        Flex="1">
                        <Editor>
                            <ext:TextField runat="server" AllowBlank="false" />
                        </Editor>
                    </ext:Column>
    
    
                    <ext:Column
                        runat="server"
                        Text="Light"
                        DataIndex="light"
                        Width="130">
                        <Editor>
                            <ext:ComboBox runat="server"
                                TypeAhead="true"
                                SelectOnTab="true">
                                <Items>
                                    <ext:ListItem Text="Shade" />
                                    <ext:ListItem Text="Mostly Shady" />
                                    <ext:ListItem Text="Sun or Shade" />
                                    <ext:ListItem Text="Mostly Sunny" />
                                    <ext:ListItem Text="Sunny" />
                                </Items>
                            </ext:ComboBox>
                        </Editor>
                    </ext:Column>
    
    
                    <ext:Column
                        runat="server"
                        Text="Price"
                        DataIndex="price"
                        Width="70"
                        Align="right">
                        <Renderer Format="UsMoney" />
                        <Editor>
                            <ext:NumberField runat="server" AllowBlank="false" MinValue="0" MaxValue="100000">
                            </ext:NumberField>
                        </Editor>
                    </ext:Column>
    
    
                    <ext:DateColumn
                        runat="server"
                        Text="Available"
                        DataIndex="availability"
                        Width="95"
                        Format="MMM dd, yyyy">
                        <Editor>
                            <ext:DateField runat="server"
                                Format="yyyy-MM-dd"
                                MinDate="01.01.2006"
                                DisabledDays="0,6"
                                DisabledDaysText="Plants are not available on the weekends">
                            </ext:DateField>
                        </Editor>
                    </ext:DateColumn>
    
    
                    <ext:CheckColumn
                        runat="server"
                        Text="Indoor?"
                        DataIndex="indoor"
                        StopSelection="false"
                        Editable="true"
                        Width="55" />
    
    
                    <ext:ImageCommandColumn runat="server" Width="30" Sortable="false">
                        <Commands>
                            <ext:ImageCommand Icon="Decline" ToolTip-Text="Delete Plant" CommandName="delete">
                            </ext:ImageCommand>
                        </Commands>
                        <Listeners>
                            <Command Handler="this.up('gridpanel').store.removeAt(recordIndex);" />
                        </Listeners>
                    </ext:ImageCommandColumn>
                </Columns>
            </ColumnModel>
            <SelectionModel>
                <ext:CellSelectionModel runat="server" />
            </SelectionModel>
            <Plugins>
                <ext:CellEditing runat="server" ClicksToEdit="1" />
            </Plugins>
        </ext:GridPanel>
    
    
        <ext:ToolTip
            ID="ttGridPlants" IDMode="Static" runat="server"
            Target="=App.gridPlants.getView().el"
            Delegate=".x-grid-cell"
            TrackMouse="true">
            <Listeners>
                <Show Handler="onShowTtGridPlants(this, App.gridPlants);" />
            </Listeners>
        </ext:ToolTip>
    </body>
    </html>
    Last edited by fabricio.murta; Jun 01, 2016 at 3:00 PM.
  2. #2
    Hello!

    Can you further detail how do you reproduce the situation where toolTip.triggerElement is null? I tried some things like editing and then coming back but it always has something bound to this variable at least on the context of your onShowTtGridPlants() function (between lines 33 and 50).
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hi Fabricio,
    to reproduce the problem, just take the mouse over into a cell.
    Jimmy
  4. #4
    Hello Jimmy!

    I have tried this several times but couldn't reproduce even once.

    What web browser would you be using? Tried on Chrome 49 and IE11 for no avail. Are you using latest Ext.NET version? From SVN? From NuGet?

    I tried with both Ext.NET 3.3.0 NuGet and latest from SVN and both works just fine in the example.
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Hi Fabricio,
    the other day I was using FF and Firebug, and toolTip.triggerElement was null.
    Today I no longer have the problem.
    Sorry.
    Thank you for your time.

    Jimmy
  6. #6
    Hello @xeo4.it!

    That's strange! Maybe due to another concurrent framework running on the same page Ext.NET does? Or plugin attached to Firefox?

    Well, but I'm glad you also can't reproduce the problem now. But if you come back up to be able to reproduce the issue in a consistent form, please let us know!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 5
    Last Post: Sep 20, 2017, 12:23 AM
  2. Replies: 3
    Last Post: Nov 22, 2013, 10:13 PM
  3. Replies: 2
    Last Post: Aug 23, 2013, 11:11 PM
  4. [CLOSED] Editable Plugin doesn't work with Chrome
    By anup in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Jul 03, 2013, 4:37 AM
  5. [CLOSED] GridPanel Row Tooltip ShowDelay doesn't work.
    By drkoh in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 06, 2010, 4:05 PM

Posting Permissions