I have right now a problem.
I created a View in my MySQL instance to get the result of multiples joins.
Then in the appmaker i got that view as a Google Cloud SQL View. I drop this as table and made a query script to apply filters to the results (filters are made by the value of 3 dropdowns).
But now i have a problem: Sort does not work! I click in any header of the table and the arrow (sort indicator) appears, but sort does not work.
Someone have a solution for this?
query script:
var status = query.parameters.Status;
var operation = query.parameters.Operation;
var local = query.parameters.Local;
var concat = query.parameters.Concat;
var query = app.models.DRIVERS_LIST.newQuery();
switch(status) {
case 'Activos':
query.filters.DoprEndDate._equals = null;
query.sorting.Name._ascending();
break;
case 'Inactivos':
query.filters.DoprEndDate._notEquals = null;
//query.sorting.Name._ascending();
break;
case 'Todos':
query.clearFilters();
//query.sorting.Name._ascending();
break;
default:
query.filters.DoprEndDate._equals = null;
query.sorting.Name._ascending();
}
if (operation !== null) {
query.filters.Operation._equals = operation;
//query.sorting.Name._ascending();
}
if (local !== null) {
query.filters.Local._equals = local;
//query.sorting.Name._ascending();
}
if (concat !== null) {
query.filters.concatAll._contains = concat;
//query.sorting.Name._ascending();
}
return query.run();
When user clicks table header App Maker sets sorting to the query and passes it to the server side. In your server script you have some code, that can potentially reset sorting settings provided by user. If you want to sort table on header click, then I would recommend to remove all sorting-related code from your server script.