Multi-column sorting for a repeat control having its source as document collection - sorting

Don't know whether it is possible but is there way in which I could provide multi-column sorting in a repeat control which displays field values from a document collection?

The easiest way to get the multi-column sorting is to use a Data Grid.
Out of the Extension Library box you can use the Dojo Data Grid control. Brad Balassaitis wrote a good description how to use it in his blog Xcellerant. There you can find a link to an example database too. A good starting point is the XPages "REST_DojoGrid" in database XPagesExt.nsf which is included in Extlib download also.
As an alternative you could use data grids based on jQuery like jqGrid.

You could do a lot of complicated stuff, like putting docs into a java TreeMap object in order to sort them on the fly.
Or you simply use jQuery and the tablesorter plugin: http://tablesorter.com/docs/

Related

Use hierarchical tables in SlickGrid

We have a request from our designers to build tables something like this, with rows that expand to show essentially another sub-table underneath. In KendoUI documentation, this is called "Hierarchy."
We use SlickGrid v2.3 with a few additional plugins. We currently have tables with a similar row expand/collapse like this: https://mleibman.github.io/SlickGrid/examples/example5-collapsing.html . That does not allow for a completely different set of columns in the sub-table.
The question is, can this be done in SlickGrid or not?
It might be hard to do with current SlickGrid, there's no code that handles the hierarchical part itself so that would be lot of work to implement in SlickGrid. However it is implemented in Slickgrid-Universal, which is a wrapper on top of SlickGrid. You can see Example 5 and Example 6 which shows 2 types of Tree Data grids (hierarchical or parentId refs). We use it in production for a project that we have. Also note that this is not a grid within a grid, it's rather an expand/collapse the same as what you found in example5-collapsing.html, the only differences with SlickGrid is that Slickgrid-Universal has the code to deal with hierarchical data (filtering/sorting) while SlickGrid itself doesn't and also another nice to know thing is that expand/collapse is actually using data filtering behind the scene and you can see that in the total items displayed when you have the footer enabled.
Please note that I'm the author of Slickgrid-Universal and also a major contributor to SlickGrid as well
At the moment, it can't be done. In order to achieve its speed, Slickgrid enforces a fixed row height and a single scrolling canvas. It's just a different approach than used by HTML display grids.
You could put together a workaround using mutiple slickgrids or an embedded slickgrid in a group row, I suppose, but it would be messy.
One thing I have done is develop a SlickCombo, which is essentially a grid presented as a multi-column dropdown. It's a full grid and can offer editing.
That's probably as close as you'd get.
A comment: the MLeibman repo is long dead - you should be using: https://github.com/6pac/SlickGrid

Radzen DataGrid Custom Filtering

I am moving to Blazor and attempting to work out how to use custom filtering in Radzen's DataGrid. Here is an example of what I am looking to do (from the old app I need to migrate):
As you can see, there is a filtering section above the grid. Of course I know that Radzen has built-in filtering in the grid itself, but that doesn't help when the filter you want to apply is to a column that is not visible on the grid..
So basically: how do you filter on columns that are not in the grid? I am using OData.. if there is a way I can modify the OData filter when the search button is clicked and reload the grid, that would be helpful.
Sorry if I misunderstood you. As you said, when search button clicked you can load data from the DB by using oData filter and reload the Radzen data grid.
then just call StateHasChanged();
I worked out a solution. You can see it here: https://forum.radzen.com/t/radzen-datagrid-custom-filtering/9448/12
Basically I copied their code from /Radzen.Blazor/QueryableExtension.cs and modified the ToODataFilterString() method to use a collection of FilterDescriptor instead of RadzenGridColumn<T>.. As the name implies, it returns an OData query string.. which I use to filter the grid's data. A working example, with full source code can be found here: https://github.com/gordon-matt/Extenso/tree/develop/Demos/Demo.Extenso.AspNetCore.Blazor.OData

Is it possible to filter a subgrid based on what is selected in a dropdown field?

Is it possible to filter a subgrid (Or some sort of list) based on what a user has selected in a dropdown field? If yes, how can I do this?
There is no easy way to do this.
For previous versions, there were some approaches to achieve this requirement (supported or unsupported way). Later this broke and ended up with community recommended Plugin approach. Read more
Since this is picklist dependent, I would assume the list items are few, probably you can build views based on dropdown values & manipulate the subgrid view based on the form value. Read more
Worst case, you can build a custom HTML webresource to render a grid by querying using web api filters.

jqGrid special Sorting

I have this data presented in a view with a jqGrid table.
It has a complex sorting order of rows done server side.
Now I need to be able to do some "free" sorting of the rows at the View.
By free I mean that the client needs to be able to move a row up or down to any place they want, skipping all the other sorting rules done at server.
Of course, this will need to be saved to the database later.
I thought that maybe add a column with an Up and Down arrow, that when clicked it will move the row to where it needs to be.
I'm not at my best with JavaScript, and I can't seem to find any examples of something similar to this anywhere.
Any tips on how could I approach do this?
Or is there a better option?
Thanks.
There is the Sortable Rows feature built into the jqGrid.
You set it up with the following API call:
jQuery("#yourgridid").jqGrid('sortableRows', options);
It uses the jquery-ui Sortable widget for this so the optional options parameter can be used for any of the available options for the widget which you can find here.
For Example:
jQuery("#yourgridid").jqGrid('sortableRows', { cursor: 'crosshair' });
You can see a sample of this on the Demo page. (New in Version 3.6 -> Sortable Rows)

How to Custom Search Panel In jQGrid

How Custom Search Panel In jQgrid example I Want translate search operation example equal to = or greaderthen > or ... or translate to arabic,
thanks all
I have perused the jqGrid wiki and found two pages which might help you.
This page talks about custom searching and its parameters. Notice that you can bind to the beforeSearch event and fire your own function, and parse the search text to accomplish whatever you want.
There is also toolbar searching, which allows custom filtering on each field in your data table. Depending on your solution, you may want to pursue this path. Again, this option also has events that you can bind to if the default search options don't fit your need.

Resources