Kendo grid sorting in desc order - grails

I am using Kendo grid in my Grails app and my requirement is to sort "date" column in descending order as soon as the row get inserted, so that most recent date comes at the top row in the grid.
How do I sort by the date column?

Default sort criteria is a property on your dataSource:
sort: { field: "date", dir: "desc"}

Related

Query and its total row

I have a table generated by a query with data drawn from another sheet. At the end of of the table, I am adding a total-row.
When the rows generated by the query is more, total-row restricts the table. Is there any way to detect the number of rows generated by the query and insert more rows above the total-row?
I have the number of rows generated by the query displayed in a cell and row number of total-row in another cell. Can a macro be triggered when the first is more than the second?
Regards,
Pravin Kumar.
It is not possible to append the total row, since it depends on the query result and it will generate a redundancy problem. Any solution to that?
add it into your query in array {}. lets say your QUERY outputs 3 columns and 3rd column holds the sum:
={QUERY(A:C, "select A,B,sum(C) where A = 'xx' group by A,B label sum(C)''", 0);
"Total", "", QUERY(A:C, "select sum(C) where A = 'xx' label sum(C)''")}
or to add row between:

How are indexed columns with NULL values treated?

Informix-SE 4.10, 7.32 and IDS 11.70: I have an index on a DATETIME YEAR TO FRACTION column I recently added as a timestamp to a table with ~800K rows. This column is being populated as users update or add new rows. So far, ~7K rows have DATETIME values, but the rest are NULL. How does SE and IDS treat the rows with NULL valued DATETIME columns when querying, updating and sorting?.. Are those rows ignored? The reason for the index is to support a query to find the most recently added or updated row with a "select max(datetime_col)" statement. Would a descending order index on this column provide better performance?
Sorting for a descending order the NULLS will be the last, in the ascending (default) will be in the top.
But the way it is treated depend on the way you filter your data.
You cannot compare NULL with a value, it is always false.
Hence, if in that table you try to fetch all rows in which the date is greater than CURRENT the rows with the column in NULL will not be fetch.
In a similar away if you try to fetch all rows in which the date is lesser than CURRENT the rows with the column in NULL will not be fetch.
What you want is to test it if it IS NULL or IS NOT NULL.

Kendo UI-single column,multi column search

I did a some Google about kendoui column search and feel no exact answer for me so i am posting it here. Please help or guide me where i can find my requirement.
I am going to integrate Kendoui Grid to load huge amount of data from my database, with that I wants to have single as well multi column search functionality in the grid.
My requirement us when a user key in their search value then the grid should filter the value using single column as well multi column search like the below image
I wants to implement the same search in kendo ui.
I know kendoui has filter functionality but, I exactly wants the functionality like the below.
Thanks in advance
You can use the filter method of the grid's data source to perform filtering. Something like this:
grid.dataSource.filter( {
// display items that meet any of the conditions
logic: "or",
// filter conditions
filters: [
{ field: "CompanyName", operator: "contains", value: "searchstring" },
{ field: "Country", operator: "contains", value: "searchstring" }
]
});

Filter pivot table conditionally

I need to make a pivot table of sales by cities. How can I filter it such that for Toronto and Montreal it will show sales > 50K and for other cities sales > 25K?
You'll need to adjust your source data to include a new column for "filtered" values. That column will have a formula to include your criteria. For example:
=if([city name]="Toronto",if([value]>50000,[value],if([value]>25000,[value],0)),0)
Then in the pivot table you use the new 'filtered value' column and filter out anything that is 0.

Does fusion tables support inserts with times?

I'm using the query API to insert a datetime with this format: '2013-06-25T21:57:25.033-07:00'
But in the table it only shows up with date-precision, the time is dropped. How can I include the time?
You need to configure the column to the correct date format on the Fusion Table in question.
Open Google Fusion Table Interface > Change Column > Select Date/Time Column > Select Appropriate Date Format: http://i.stack.imgur.com/OUz4N.png

Resources