I am currently making a custom data table using advanced datatable package. Now managed to make it looked good, following the design I was given except one, how to make the last row different than the rest, fixed one where even if the user navigate to next page of table, the last row will still be there. Pretty much like this.
(sorry for the squared censors...)
I am trying to make the last row look like the "Total" row, so to make something like this in advanced data table? Or any other suggestion for a better paginated data table package?
Related
I am creating android app using Kotlin. I have fully functional multi column sorting. When I click on table header column it adds it index to sorting column list. It sorts both ways (ascending and descending). On click it changes direction. Everything works fine. But I would like to know what would be the best solution to remove sorting from one column.
I have few ideas but they don't sound good:
On third column click remove sorting on that column.
Add button which is visible when column is sorted. Button on click removes column from sorted list.
I would like some help because I don't know how to implement this feature in a good way.
Edit1:
Forgot to mention that sorting happens in back-end. In android I just set parameters which columns I need to sort and then send GET request to the server. As response I get sorted data.
I would mimic the way Google Spreadsheets does:
It shows a dialog and you can add sort columns and delete them.
You can see it by selecting some columns and going to Data / Sort the range.
Another possibility would be to have a 3 states switch in each column (sort ascending, sort descending, not sort). Here you can see it working in a website (look at the Multiple column sorting example): http://demos.shieldui.com/web/grid-general/sorting but, in my opinion, it is more confusing.
Hope this helps.
In an older app, I used straight SqlLite, built list adapters, had and XML file for the activity and another one for each item.... is there a new "magic" way to do this with Room? Room I have up and running, it can create the tables and stick data in, fine. But what is(are) the proper way(s) to show the data? Is it LiveData or nothing?
For this app, we're talking about displaying small (under 100) items in a scrolling view. Each one is only showing two items of text, you'll tap and edit one of the fields, save it, and done.
A recipe list of the actual files/classes I'll need to create would be super. I've seen plenty of code snippets but there's very little clarity on where those pieces live, and the XML layout files which seem like they must exist never get mentioned.
In my app I download from the net some data I need to arrange in a table way.
I already know dimensions: about 26 rows and 6 columns, anyway data can change across subsequent calls so I have to create this table in a dynamic way.
As it is a table I though using a TableLayout (never used before), on the other hand I could simply use a list view, using for the single item a 6 elements linear layout with horizontal orientation.
ListView intrigues me because it is an adapter view (I think I'll store this data in a sqllite db, later) so populating it is quite simple and straightforward, anyway I don't know if it is the best for my problem.
What is your opinion?TableLayout, ListView or other?
When it comes to performance, I think you should use ListView because ListView support Recycling of view and you can check this and this post for more detail regarding Recycling of view.
Hope it helps :)
A ListView is a collection of layouts that are automatically displayed one below the other. The developer adds new items through a piece of code in the Activity. An example is the address book where you have lots of contacts one after the other.
A TableView on the other hand is defined in the layout file and does not only need to contain elements below or above each other but can also arrange elements on the left or on the right. A TableView is exactly what it says: A table with rows and columns.
here's a similar question that might answer what you want to know
I'm developing for GoogleTV and I have created a dynamic table with 3 columns (using TableLayout), that shows the first 10 results fetched by HTTP from a Website.
As the user starts scrolling through the elements in the table (only rows are selectable, not columns), I want more results (rows) to be fetched and presented instantly (something like Google Reader).
To achieve that I'm using an AsyncTask that fetches more results from the Website, and adds them to the table. The problem is that I find it's behavior a little bit sluggish and unnatural, so I think that I may not be using the right approach.
Is there a better alternative to using TableLayout + AsyncTask? I have chosen TableLayout instead of ListView because I want to display the results in a "table-like" manner so it's easier to absorb the information.
Thanks for the replies.
Following on from this question:
ideal database field for calling data to
I have realised that I might be able to simplify my need for information to be brought to the screen by using a Dialog or a Custom Dialog, and by one of these methods I may call the whole finished page from a database instead of using static strings into the layout filling in specific fields with data like I am currently.
There could be a few hundred items or pieces of data to be called up in my App So am I correct with this assumption or do I need a specific other method to acheive this?
I am looking to call a custom dailog from a database so I can call a whole page of information complete but am unsure of limitations on this data wise or even if my sqlite database manager is even good enough for this task, each page will be called up "complete" where as before I was trying to have a template with the unchanging data (coke pepsi etc.)already included and appearing on every "result" page and then blank fields populated with data retrieved from a sqlite database (Litres size etc...) I am unsure which path to take : either make the page complete including all data like an image Or do I stick with my original plan to have a template screen with unchanging fields already in place and the changing information to be populated as needed from a Sqlite Database? hope this makes sense sorry if I was too vague with my question originally Im still learning.
Your question is vague but I'll risk an answer:
If you want to make a dialog like the image you posted on your previous question then this is the way to do it:
Create a custom dialog that will have as content a LinearLayout(with 3 TextViews representing the header labels in your image: COMPONENT, TYPE and AMOUNT, this will be somewhat identical to the list row layout below) + a ListView where the actual data will be shown.
Create a layout file for your ListView row to use(like the LinearLayout above will contain 3 TextViews for the drink name, type number and amount number).
When the dialog needs to be shown just get from the database all the drinks names, types and amounts and bind it to the ListView with one of the adapters based on a Cursor(like a SimpleCursorAdapter)
Getting the values from the database and binding them to many TextViews is not recommended(If you have many(I saw few hundred items or pieces of data)), also your dialog could be called a lot of times by the user in a short period of time and you don't want to do this binding each time for many views.
either make the page complete including all data like an image
Please don't do this!