Plex 2E

Expand all | Collapse all

Dynamic filters in grid

  • 1.  Dynamic filters in grid

    Posted Feb 05, 2016 09:06 AM

    Hi all i'm trying to find a decent ui for filters in grids, what i want to do is for example select a cell and with right click set a filter for this cell (i need the implementation name of the cell to call a block fetch sql, is possible to retrieve?).

    But i cannot find a method to get the impl name (i can get the col number and retrieve the col name, but if there are two columns with the same name how i get the right impl name?)

     

    Maybe is possible to find the value of the cell (but if there are two cell with the same value?)

     

    Does anybody have a good idea for me?

     

     

    Thanks



  • 2.  Re: Dynamic filters in grid

    Posted Feb 16, 2016 02:51 PM

    Hi,

     

    Try to get field index from Col number, and correspond that with field in the GridP variable.

     

    If the field order in the GridP variable match with the field index, you can get the field impl name.

     

    Regards

    AA



  • 3.  Re: Dynamic filters in grid

    Posted Feb 17, 2016 02:42 AM

    You could use IF FOCUS as work around as the grid would have to be editable  Know at Run time which Cell in a grid is selected

     

    Using If Focus on a Region

    If a variable is specified on the If Focus statement (rather than a particular field), it must be the variable corresponding to the required region. For a single instance region, this means that the construct is true if any of the controls within the region has focus. For a grid region, the effect of it is implementation independent:

     

     

    On a Windows grid, the If Focus is true only if a field on the current row of the grid has focus.

     

     

    On an System i 5250 grid, the If Focus is true if the cursor is positioned anywhere within the region.

     

     

    Note: An If Focus statement does not work on read-only grids. This statement always returns false, even if the read-only grid has focus.



  • 4.  Re: Dynamic filters in grid

    Posted Feb 17, 2016 07:06 AM

    Hi guys thanks for the answers,

     

    George: i would like to use read-only grids (or read only fields), ther's no others way in your opinion?

    AA: unfortunately the field order in the GridP does not match with the field index.

     

    At the moment the only idea that i have is to insert a new empty and editable row on top, and then use it like a filter values.

     

    Other suggestions?



  • 5.  Re: Dynamic filters in grid

    Posted Feb 17, 2016 07:49 AM

    Hi, 

     

    The possibility of using "Col Name" exist.

     

    The Column Heading is resolved in the following order.

     

    1. FLD top label LBL triple.

     

    2. FLD name NME triple.

     

    3. Field's object name.

     

    4. Panel designer :  Column Heading - Text.

     

    Plex does not allow duplicates for Name or Object name.

     

    Having unique col name in the Grid or Making the field(s) that involves setting filter to be made editable (not entire grid.) are possible solution.

     

    Regards

    AA



  • 6.  Re: Dynamic filters in grid

    Posted Feb 17, 2016 08:40 AM

    Hi AA, Having unique col name in the Grid could be an option but, unfortunately, not in my case (I have Col Name based on different labels, not from fields, and to change this i have to manage too many panels.)

    Editable grids for filters have an "unpleasant" usability.

    By the way thanks for the ideas.

     

    Corrado



  • 7.  Re: Dynamic filters in grid

    Posted Feb 17, 2016 10:09 AM

    My solution would be.

     

    Create a right Context menu with the column headings as options

    When you select the right context menu option in the action diagram you will know which field the user was talking about as he will have choosen the appropriate menu option. Then you can code accordingly in the action diagram with the value of the field in the selected row. Cavet the grid must be single select



  • 8.  Re: Dynamic filters in grid

    Posted Feb 17, 2016 10:57 AM

    will this work for you? such as the follwoing this screen shot which shows right context menus on a plex grid Registered Functions - Stella Tools (CA Plex Developer Tools)



  • 9.  Re: Dynamic filters in grid

    Posted Feb 18, 2016 03:56 AM

    Nice idea George, but is it possible to class a metacode that add, to the right click context menu, the field name of the panel region?

     

    Thanks
    Corrado



  • 10.  Re: Dynamic filters in grid

    Posted Feb 18, 2016 04:27 AM

    nope.

     

    Get some of the way by creating GridWithRightContextMenuFilter pattern. But you still would have had to visit your grids to add the BlockFetch work to your driver anyway so you would have needed to create a couple of grid patterns:

    GridWithDriver (grid that calls a wrapper/driver that decides which BF to call depending on filter, if you are SQL site you could format the SQL client side and pass it to a generic BF)

     

    Nice thought is to use the Checked ability on the context menu to indicate what filter mode is currently in play



  • 11.  Re: Dynamic filters in grid
    Best Answer

    Posted Feb 22, 2016 07:58 AM

    http://www.ca.com/us/support/ca-support-online/product-content/knowledgebase-articles/faq259684.aspx?intcmp=searchresultclick&resultnum=4#.VssFfqY1Jjs.gmail

     

    Is it possible to perform secondary sorting on a grid?

    Document ID:  FAQ259684
    Last Modified Date:  2/5/2016
    Show Technical Document Details

     

     

     

    Question:

    Is it possible to perform secondary sorting on a grid where the user can click on a column to sort the grid by that column, and then click on another column to perform a secondary sort within the first column that was selected?

    Answer:

    The built-in grid control within CA Plex only supports one level of sorting. However, you can achieve multiple levels of sorting by creating views with multiple key fields. Each view would need to have a BlockFetch function scoped to it, and then you will need a driver function that determines which BlockFetch function to call depending on what the user wants to sort by. On the panel of the UI function, you will need a radio button (or some other control) for the end user to select the sort order to display. You will also need to replace the call to the original BlockFetch function with the driver function passing in a parameter of the sort option the user selected so that the driver function can determine which BlockFetch function to call.



  • 12.  Re: Dynamic filters in grid

    Posted Feb 22, 2016 09:28 AM

    Thanks George and AA for the answers.

    A workaround should be to create a new row (on top) of all grids, set only this row as editable and use this row for filters.

     

     

    Corrado



  • 13.  Re: Dynamic filters in grid

    Posted Feb 22, 2016 10:05 AM

    would be nice to have Frozen Row.....separate single instance above grids...maybe set column headings to visisble No...and have a row of buttons to mimic the clickable colum headings....

     

    Or make the Grid full grid load and therefore the first row can be inserted as you outline...

     

    or work out the page load sequence...so that you can make the first visible row at any one time to be editable...

     

    all a little messy...

     

    Also when the user sorts the grid your editable grid will move position...