Sort in a Jqgrid (on Load Complete) - sorting

I'm facing the same problem as explain in this post.
In my case, I'm loading the data into the grid with JSON. Unfortunately I cannot change the query to do the sorting so I've tried to replicate what Oleg and Ruffp suggest but i don't use "if (data.nodeType)". Now even if the grid is sorting, I can't select any row because when I place the mouse pointer inside the grid, it starts to blink or flash (Maybe I'm having recursions in the execution of the grid, but I'm not sure).
Should I put the timeout inside an if clause? Using something different than data.nodeType because I'm using JSON? In that case, which should be the clause?
Thanks for your help !

If I understand you correct you will find the answer on your question here. I suppose that you use datatype: "json" and loadonce: true options and loads from the server full unsorted data (without paging and sorting). If you implemented paging on the server, but no sorting then you should find the solution of your problem in another answer.

Related

how eliminate orphans when filtering in RDL SSRS

I filtered my report based on a certain expression. Those that do not meet the criteria that I put in my IFF expression are then filtered and those that do meet it, are shown in my report. My report is multiple pages, so when the filtering happens, some records are left alone on a page, and are not moved up. This leaves a lot of whitespace, and I would like to get rid of that.
On page 1, there will be 2 images/records, with space for one more
On page 2, there will be only 1 image/record that would fit on page one, but doesn't move up
on page 3, there will be only 1 image/record that would fit on page 2 but stays on page 1 etc...
my Keeptogether value is set to true, however this does not help. I have been trying to find something that will keep these records together when filter happens, so that the number of pages is minimal.
If someone could help, I'd really appreciate it.
Regards
Jay
Are you "filtering" via the Visibility in Properties? Because such way will just hide, rather than rule out, the records/images you don't want. If that's the case, try filtering via the Filter in the Properties of the tablix (or Groups, if it applys to your case). But I think the best way is to do the filter job in you data set query, because that will provide you best performance.
So i resolved my problem by adding my IFF expression that I orginially had in the visibility option to the filter by expression option. Everything now moves up and the extra white space that was there before is gone.
Thank you for your help!! :)

How can I query kendo trees and MVVM models?

According to the docs I should be able to do this ...
$("#tree").data("kendoTreeView").expand(".k-item");
Great if i want to expand everything, but what if i only want to expand nodes where the property "expanded" in my model items is set to true?
Is there a way i can query the tree based on something in the model then perform an action on all results?
The real answer here is quite long, the short version being as with everything kendo, spend hours with support to be given half the solution and told to write the rest yourself.
I got round this problem by using another library (jslinq) to query the model data.
This is yet another frustrating issue with kendo that really should at the very least be offered as a core part of the heirarchy data source at some basic level (essentially an incomplete implementation).

Shorter link urls in Wicket

I am creating an application with a lot of links. Because the links are contained in cells in a table, the urls that are generated by Wicket tend to get long, making the page slower to load.
For example:
2011-06-09 00:00:00.0
I try to figure out where to start exploring the encoding / decoding of URLs, but it is rather complex material. My first approach was to just use 'short' names for components (like "t", "f" etc). I can imagine there is a better approach.
I can image it would be possible just to 'number' the links; as the page still exists, so I would end up with something like this:
2011-06-09 00:00:00.0
Are there solutions for my problem already out there, or can anyone point me to the right direction?
If a Javascript solution is acceptable, you can use a single event listener on the whole table instead of many links in the table.
See this example for an inspiration:
https://github.com/svenmeier/apachecon-wicket/tree/master/src/main/java/eu/apachecon/base/ui/performance
Notice how the Ajax behavior transports dynamic extra parameters to the server. It looks for rows only though. if you need to distinguish between table cells being clicked, you'll have to expand on the idea.
The solution suggested by Sven is the better solution.
Here is a solution which you may call fundamental: register your own root IRequestMapper that will compress/uncompress the generated urls by the real mappers. See CryptoMapper and HttpsMapper for example of custom root mapper.

Solution for Magento mass actions and large number of records problem?

Currently Magento has a problem with the way it handles mass actions. It returns a bit of JS that contains EVERY db id for the current collection and filter, regardless of pagination. This is to support the 'Select All' vs. 'Select All Visible' option in the grid header. This isn't such a problem when you have a smaller number of records, but if you have 850k records (orders in this case) it becomes a serious problem.
My question is, does anyone have an elegant solution to this problem?
I can think of several solutions, each with its own drawbacks, but I'm hoping someone has solved this in a simple manner that works as an add-on module. Paid or Open-Source solutions are both welcome suggestions.
Clarification:
I'm looking for an elegant/drop-in solution to the problem of 850k+ records using the grid widget in Magento. The stock Magento code makes the bone headed decision to return the id for every record that is matched by the current filter, even if they are not being displayed. This is not about offline processing of records, it's about using the grid widget for daily admin tasks.
One possible solution would be to store the results of the filtered search in a temp table and return a reference to the search result. Then you could change it from using the actual ids on a 'Select All' to using a specific callback for the action using the reference. This would preserve the current behavior.
So, to ask again, does anyone have a good solution to this already created?
I'm running heavy operations from within a shell script. I have a generic iterator (in my case products, but can be done with everything else), and I only implement a class that does the action on the product. My product_iterator shell script takes care of looping over the products, while processing only x products at once (to avoid memory leaks).
Well, the least invasive solution to the problem is to turn off the 'Select All' option for grids with large numbers of records. This is easily accomplished by extending the grid class and adding the following code:
protected function _prepareMassaction()
{
$this->getMassactionBlock()->setUseSelectAll(false);
return parent::_prepareMassaction();
}
I think that fbmc has the right general approach. Clearly, even if you did find a way to send back all 850k records, the framework would have a heart attack attempting to deal with them all. Run the logic in a shell script if this is what you need. For some jobs, you may even need to run them in batches or move down to actual SQL logic.
Unfortunately, some parts of the framework were not made to handle this kind of scale. You've found one of them.
Hope that helps!
Thanks,
Joe
Recently i have written an article about 'Adding new mass action to admin grid in Magento',
Hopefully you will like it:
http://www.blog.magepsycho.com/adding-new-mass-action-to-admin-grid-in-magento/
It describes the two way for adding Mass Action
1> Extending Grid Layouts _prepareMassaction() method
2> Using event: core_block_abstract_prepare_layout_before (more upgrade proof way)
Thanks
Regards

jqGrid recreateForm parameter

I would like to know where is the correct ubication of the following sentence:
jQuery.extend(jQuery.jgrid.edit, {recreateForm: true}).
I found here that setting it, you can solve problems with edition of rows, when you are using custom edittype columns, in respect of these type of fields don't refresh between successive editing records. But I proved it without positive results.
I'm using form editing.
Thanks for your helping.
jQuery.extend(jQuery.jgrid.edit, {recreateForm: true});
is the correct code to change default value of recreateForm to true. You can find in my answer in the forum of http://www.trirand.com other different variation to set recreateForm to true.
If this will not help you, you have probably another problem in your code. You can append your question with the code which can be used to reproduce your problem. I or somebody else could try to solve your problem.

Resources