I have a problem to use subgrid. I want to use the nice feature of loadoce(local search etc.). And I also want to use subgrid.
But it doen't work to put them together. I don't know if it's a bug or I miss some thing.
If I set loadonce:false, the subgrid works.
I tried both 3.7.1 and 3.7.2
Or should I only use one at a time?
Many thanks!
This is possible in JQGrid 3.8, at least - and 4.0 (I have not tried JQGrid < 3.8).
Please be certain to have your subGridType set, if you want to be using loadonce:true, as that'll override the change from datatype:X(where X is what you set it to) to datatype:local(for your subgrid). You probably know you'll have to set editUrl:clientArray for the local searches to work.
An example from a grid where I'm using the settings you want:
jQuery("#MyGrid").jqGrid({
colNames:['Customer','Value.','Customer ID']
,colModel:[
{name:'customer_name',index:'customer_name',sortable:true},
{name:'value',index:'value',sortable:true,align:'right',width:'100px',formatter:'number',formatoptions:{decimalSeparator:',',thousandsSeparator:'.',decimalPlaces:1,defaultValue:'0.00'}},
{name:'customer_id',index:'customer_id',hidden:true}]
,sortname:'customer_id'
,caption:'mycap'
,datatype:'json'
,loadonce:true
,rowNum:100
,footerrow:true
,pager:false
,userDataOnFooter:true
,sortorder:'asc'
,subGrid:true
,sortable:true
,height:'auto'
,viewrecords:true
,subgridtype:'json'
,url:'?q=1'
,editurl:'?q=1&p=1'
,autowidth:true
,altRows:true
,shrinkToFit:true
,subGridUrl:'/myurl?q=1&sub=1'
,subGridModel:[{name:['Additional Info','Subtotal'],width:[170,60],params:['customer_id']}]
});
Related
I’m trying to create a new dataset type Powerapps Component (PCF). For the moment I am using it to display a view of the records that are available in an entity in Microsoft Dynamics CRM.
I wish to make the view sort itself when I click on the grid column headers (in a similar way that the default CRM grid view does). I'm trying to figure out how to apply a sort to the dataset so that I can refresh it as indicated by the documentation for the dataset.refresh() function:
Refreshes the dataset based on filters, sorting, linking, new column.
New data will be pushed to control in another 'updateView' cycle.
The dataset object does have a “sorting” property, but changing its value and then refreshing the dataset doesn’t seem to have any effect. After the refresh, the sorting property reverts to the value it had before I changed it.
In short, the click handler for the grid header does something like the following bit of code. The refresh gets done and my updateView() function gets called as expected but the sorting was not applied.
dataset.sorting = [{name: 'createdon', sortDirection: 1}];
dataset.refresh();
Any help on getting the dataset sorting to work would be appreciated.
I've been experimenting with PowerApps Component Framework a little bit recently and I can confirm that the following code won't be working:
dataSet.sorting = [ { name: "columnName", sortDirection: 0 } ];
However, I managed to get this one working for me:
dataSet.sorting.pop(); // you may want to clean up the whole collection
dataSet.sorting.push({ name: "columnName", sortDirection: 0 });
I haven't really figured out the reason of this behavior. The sorting array may be implemented as some form of observable collection in the background.
I hope this will guide you to a functioning solution.
The documentation is pretty abysmal here, but here is my best guess from putting a few different pieces of information together.
TLDR: I think there is some kind of extra method that needs to be called on the .sorting property, but I can't find out what it is called. Maybe something like:
dataset.sorting.setSorting({name: 'createdon', sortDirection: 1});
I think you're going to have to try a bunch of likely method names and see what works.
Background and links:
The only reference I could find to dataset.sorting was from here:
In this preview for canvas apps, only a limited set of filtering and sortStatus methods are supported. Filter and sort can be applied to dataset on primary type columns except for the GUID. Filter and sorting can be applied in the same way as in model-driven apps.To retrieve the dataset with filtering and sorting information, call
the methods in context.parameters.[dataset_property_name].filtering
and context.parameters.[dataset_property_name].sorting, then invoke
the context.parameters.[dataset_property_name].refresh().
So it seems that the .filtering and .sorting properties are handled similarly, and that there are some methods attached to them, and only some are supported. That is about as vague as they could make it...
I did find an example of how .filtering is used:
_context.parameters.sampleDataset.filtering.setFilter({
conditions: conditionArray,
filterOperator: 1, // Or
});
There is a brief reference to .setFilter() in the docs, as well as FilterExpression
There is a SortStatus reference, but it doesn't have any corresponding methods explicitly called out. It is possible that this is not yet a supported feature in the public preview, or the documentation is lacking and the name and syntax of the method you need to call on .sorting is not yet documented.
jqGridImport is not a function
On version 5.3.2, when I try to call the jqGridImport function, it cannot be found. But jqGridExport works just fine.
$('#myGrid').jqGrid('jqGridImport', options)
or
$('#myGrid').jqGridImport(options)
According to the Import/Export documentation it should work just fine.
It seems to me that you use the Guriddo jqGrid, but read the old docs for jqGrid <=4.7
The correct linkt is Guriddo documentation
With simple word you will need not to apply the method to the grid, but pass the id as parameter to it. Try:
$.jgrid.jqGridImport( "#myGrid", options );
I've the following problem: in my TYPO3 backend (TYPO3 8.7.24) I've got multiple SysFoldern for my tt_products items (just to arrange everything a bit). But in the list view the sorting arrows are missing.
TYPO3-Backend-Sorting_ListView
TYPO3 was setup freshly in the version 8. For tt_products (v 2.9.4) I'm using the followig addition in the template.
plugin.tt_products.conf.tt_products.LIST.orderBy = sorting
You can allow manual sorting of products in the backend with TypoScript, but it is slightly different:
plugin.tt_products.conf.tt_products.orderBy = sorting
plugin.tt_products.conf.tt_products.LIST.orderBy = sorting works in frontend only. In the Backend sorting of the products is hard-coded to be by title. If you want to change it, you would need to adjust table definition ($TCA) with another extension.
You must configure tt_products in the backend settings (previously in the extension manager).
Order tables by sorting
basic.orderBySortingTables (string)
Enter this:
tt_products,tt_products_language
This will enable the sorting arrows in the backend list module.
I am trying to support case-insensitive ordering in my Spring MVC app when users click on the column headings on my web page. When the page is rendered a Thymeleaf extension creates an anchor and the href is the current URL with some parameters supported by Pageable: i.e. page, size and sort.
The sort=propertyName,ASC format works fine, but I can't find out how to say that the sort should be case-insensitive from the URL. I can do it in code easily enough but the standard Pageable support doesn't seem to support it.
After some debugging it appears that the standard framework org.springframework.data.web.SortHandlerMethodArgumentResolver just doesn't have any support for org.springframework.data.domain.Sort.Order.ignoreCase.
I'm somewhat bemused about this, and am wondering if there's a good reason why?
I can look into creating my own SortHandlerMethodArgumentResolver class, and make it parse ASCI|DESCI (to mean case-insensitive), and ASCS|DESCS (to mean case-sensitive) and produce the appropriate Sort object, but this strikes me as quite a bit of work and a serious "code smell".
I can't be the first person to stumble across this. Does anyone have any advice?
I think the only option is to implement your custom SortHandlerMethodArgumentResolver. The documentation has brief guideline for this http://docs.spring.io/spring-data/data-commons/docs/1.6.1.RELEASE/reference/html/repositories.html
To customize this behavior extend either SpringDataWebConfiguration or
the HATEOAS-enabled equivalent and override the pageableResolver() or
sortResolver() methods and import your customized configuration file
instead of using the #Enable-annotation.
For the format I would make it a comma-separated string of 3 elements: field name, direction, ignoreCase flag. Something like this:
sort=name,ASC,ignore
The last element is optional so it's possible to have:
sort=name,ASC
which would mean that ignoreCase is false.
Also it should be possible to specify only field name like:
sort=name
which would mean the default direction of ASC and ignoreCase is false.
The only issue is if you want to pass ignoreCase flag you must pass the direction which should not be a big problem I think.
Hope this helps!
Btw here is a JIRA item for this improvement https://jira.spring.io/browse/DATACMNS-658 (Extend SortHandlerMethodArgument resolver to be able to detect the request for ignore-case)
If somebody is using Spring Data Commons 2.3 RC1 or later and looking for query params, use following. (Ignore case in sorting is available out of the box in Spring Data Commons 2.3 RC1 and later)
sort=name,ASC,ignorecase
I have used this option in the pager widget (so I used pager_processAjaxOnInit: false), but can't tell that it has an effect. I thought it might cause the ajaxProcessing option to not run upon initial loading of the table, but that doesn't seem to be the case.
Thanks for your help.
The documentation states:
Set this option to false if your table data is preloaded into the table, but you are still using ajax (New v2.14.5).
For more details see issue #424.