vitmalina / w2ui

UI widgets for modern apps. Data table, forms, toolbars, sidebar, tabs, tooltips, popups. All under 120kb (gzipped).
http://w2ui.com
MIT License
2.63k stars 735 forks source link

Local Sort but remote data? #956

Closed hansgru closed 9 years ago

hansgru commented 9 years ago

Is it possible to have remote data but local sort ? I couldn't find out how to configure such a scenario.

This is especially required for inline editable grids: the data must be remote: to be able to load and save it, no paging is required (since the user edits the data and must see the changed cells), but the user should be able to multi-sort so that it can easier figure out what to change.

Thank you.

edgarz commented 9 years ago

just delete url attribute, and you are local. i did it like that: grid.backup_url = gird.url: delete grid.url; ... manage the local things ... grid.url = grid.backup_url ;

hansgru commented 9 years ago

@edgarz Thank you.

It is a very ugly hack though :), and I'm not sure that I can cover all the situations, since the user can reload the grid, filter, etc.

edgarz commented 9 years ago

i think the ugly hack is not to decide if you are remote or not!

edgarz commented 9 years ago

on the other hand, if you reload data, changes are lost too, so you have to to ask if record.changes is empty or not before.

edgarz commented 9 years ago

i think you should have a look on your use-case before asking for un-needed features. ....but i have seen similar questions several times. i had the same issue, when i tried to re-render a grid that i dismissed before, and wanted to get the old sort, the old filters... i think this was a use-case, as i had to manage millions of records with long query-times. and vitali helped me with this hack. i think your solution would be to use the event onChange, to set your data to be local, and onSave change it back to remote.

hansgru commented 9 years ago

@edgarz Thank you for the details.

i think you should have a look on your use-case before asking for un-needed features.

I don't think this is an "un-needed" feature :). I used it in all projects so far and it is present in other RIA frameworks where the user can fine-tune if the sort/search/filter/highlight/paging is remote or local, independent on the load/re-load/save operations.

i think your solution would be to use the event onChange, to set your data to be local, and onSave change it back to remote.

Thank you very much. I'll use for now this trick.

I still think that something like:

{
  sortMode: 'local' // allowed values: 'local' or 'remote'
  // ,filterMode: 'local'
  // ,'pagingMode: 'local'
}

would be self describing and user friendly :).

edgarz commented 9 years ago

you can do it easyly. just do the prototype on w2uigrid, it is expandable. something like w2uigrid.prototype.sortmode = function(mode){ this.onSort = function(){} } ... ok, it will not be so easy, but i did some hacks like this before.... for me, i love w2ui, as there is no pagination, and i can work on full datasets, everything reflected by server-data. how can you exspect your users-aim to sort or filter on the little data-part they see in the moment?

edgarz commented 9 years ago

on the other hand, you could change to really local datasets. do an onLoad, and an onSave (push the record-changes in it) ajax call.

hansgru commented 9 years ago

how can you exspect your users-aim to sort or filter on the little data-part they see in the moment?

That's unfortunately a requirement in many business applications. Sometimes there are many columns, the data in cells is complicated, or there are just more rows than would fit on the screen, so the users need these features while inline editing.

i love w2ui, as there is no pagination, and i can work on full datasets, everything reflected by server-data.

I also like that functionality very much and was using it with ExtJS even before w2ui had it, but in many cases really does not depend on me as a developer but what the customers request.

edgarz commented 9 years ago

but i still think, the problem is not w2ui but your application design. i worked with tables with over 100 complex columns, and every application has to decide weather to work local or remote. the user has to know if sort is local or remote... ok, if i fetch all the rows, it makes sense.

by the way where do you come from?

hansgru commented 9 years ago

ok, if i fetch all the rows, it makes sense.

Exactly. After automatically filtering the data on the server based on "user rights" in many grids the remaining number of rows is not that huge, so the user can work more like it is used to work with Excel: inline (with the added benefit that some rows or even cells can be easily made read-only). Till ~2000 rows seems to work without problems with actual browser and hardware, even if the user has several browser tab with such grids.

by the way where do you come from?

DE, but doing projects in FR, NL and UK too :).

edgarz commented 9 years ago

write me an email: ezwischenbrugger@gmail.com i have same fun with customers... i did a great excel and pdf client based export, maybe interesting for dich.

edgarz commented 9 years ago

vienna

edgarz commented 9 years ago

Hab da mal nen Java-rest-service, der 1:1 entity vs. w2ui mappt. hab deinen mirage gesehen, könnte ja irgendwie dieselbe idee sein.

edgarz commented 9 years ago

mein approach ist einfach. DB = w2ui! meine idee ist einfach, dass ich eine db ohne code ins w2ui bekomme, klar aber nicht unumgänglich ist noch der entityManager, den man aber über eclipslink auch dynamisch machen könnt

hansgru commented 9 years ago

Hab da mal nen Java-rest-service, der 1:1 entity vs. w2ui mappt.

Wir haben Grails Scaffolding benutzt: http://blog.toubiweb.com/getting-started-with-grails-scaffolding/ Ein komplettes DB-Modell kann so mit ExtJS oder KendoUI (oder w2ui bald) als GUI generiert werden. Ich darf leider den Generator nicht publizieren (der Kunde will es nicht :( ).

hab deinen mirage gesehen, könnte ja irgendwie dieselbe idee sein.

Das Mirage=Projekt gehört https://github.com/takezoe . Mirage ist sehr praktisch um SQLs auszulagern (DB-Spezialisten können getrennt arbeiten), oder auch für dynamische SQLs (dynamic als SQL kommentar)

hansgru commented 9 years ago

mein approach ist einfach. DB = w2ui!

https://github.com/vitmalina/VitsDB ?

meine idee ist einfach, dass ich eine db ohne code ins w2ui bekomme

Wir müssen den Code leider generieren, da es immer wieder ausnahmen gibt, also braucht man immer wieder Anpassungen :) )

edgarz commented 9 years ago

Genau das mach ich,so wie gwt. Am 23.06.2015 17:45 schrieb "Hans" notifications@github.com:

mein approach ist einfach. DB = w2ui!

https://github.com/vitmalina/VitsDB ?

meine idee ist einfach, dass ich eine db ohne code ins w2ui bekomme

Wir müssen den Code leider generieren, da es immer wieder ausnahmen gibt, also braucht man immer wieder Anpassungen :) )

— Reply to this email directly or view it on GitHub https://github.com/vitmalina/w2ui/issues/956#issuecomment-114551601.

vitmalina commented 9 years ago

I see you switch to German (I think), which I niht firshtein. I hope the issue was resolved. Please reopen it if not. As for VitsDB - it is really, really old. Like 5 years old. Never had time to finish it. :)