LiveSearch gridpanel plugin without statusbar

  1. #1

    LiveSearch gridpanel plugin without statusbar

    Hi, i am following this example https://examples5.ext.net/#/GridPane...ns/LiveSearch/, but i dont see a way to display the number of matches on a tag inside the liveseach control, and dont need a statusbar control for it
  2. #2
    Hello @ibambino!

    The Live Search Grid Panel component requires a status bar as it will look for one in the grid to automatically update the status of it. So, the customization you want is not supported "out of the box".

    This is not the best way to do this but the simplest way to show how modifying the component is the way to go for what you need. This will aplly if and only if all you want is to reflect what would be output to the statusbar somewhere else, say, in a Label component in the live panel's toolbar (next to the search bar).

    For that, given the example you pointed:

    1. Add a simple label within the ext:LiveSearchToolbar's Items block:

    <ext:Label runat="server" ID="Label1" Text="Nothing Found" />
    2. Wire up the status bar's setStatus() method to change the label:

    <BottomBar>
        <ext:StatusBar runat="server" DefaultText="Nothing Found" Hidden="true">
            <CustomConfig>
                <ext:ConfigItem Name="setStatus" Value="function(value) { App.Label1.setText(value.text); }" Mode="Raw" />
            </CustomConfig>
        </ext:StatusBar>
    </BottomBar>
    Notice also we set the toolbar as "hidden". It will be there, just not drawn to the page.

    Then every time the live status grid panel plugin finds the status bar and call its setStatus() command, it will relay the text to the Label component you added to the upper toolbar.

    The proper way to handle this though would either be by overriding or extending the component to introduce the new behavior; you'll probably want to update the Ext.ux.LiveSearchToolbar component.

    Overriding would benefit of being able to use the same server-side interface for the ext:LiveSearchToolbar and ext:LiveSearchGridPanel components, but (where the override is applied) will affect the component wherever it is used.

    Extending will allow you to keep the original component untouched but you'd need also to extend the server-side component for either (or both, depending on the change of behavior from the extension) component.

    Following the override or extension path may be a challenging endeavor but would open a world of possibilities for you with all Ext.NET components, making any scenario you may think of virtually possible with Ext.NET, taking advantage of all the features it brings in.

    As a side note, I've noticed the Listeners in the ext:LiveSearchGridPanel component are not being triggered and logged issue #1764 to track and correct the defect.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Fabricio, thank you very much, I will try to extend it.

Similar Threads

  1. [CLOSED] StatusBar : Reduce StatusBar Width
    By matrixwebtech in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: May 01, 2015, 1:01 PM
  2. [CLOSED] Gridpanel Livesearch Plugin Error
    By hemantpatil in forum 2.x Legacy Premium Help
    Replies: 15
    Last Post: Jul 30, 2013, 5:01 PM
  3. GridPanel change StatusBar Results
    By alanmaldonado in forum 2.x Help
    Replies: 0
    Last Post: May 11, 2013, 4:29 PM
  4. [CLOSED] Ext.ux.statusbar.StatusBar - tbFill issue
    By supera in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 08, 2013, 3:48 PM
  5. Replies: 4
    Last Post: Nov 09, 2011, 4:58 AM

Tags for this Thread

Posting Permissions