Skip to content

Load Dynamic Data #172

Open
Open

Description

@saravananraj21

Hi! I need to load dynamic data from database. How to do that ?
I want to reduce the text size of headers and table view.
Can you help me regarding this.

Activity

  1. changed the title [-]Load [/-] [+]Load Dynamic Data[/+] on Dec 18, 2018
  2. ISchwarz23 commented on Dec 18, 2018

    @ISchwarz23
    Owner

    Hi @saravananraj21,
    You can add the data to your TableDataAdapter and then trigger a new rendering by calling the notifyDataChanged() method. If you want to enable the user to trigger a refresh (pull to refresh) you could use the pro version. You can test the feature in the Example App in the section "Load Data".
    For setting the text size I need to know which TableDataAdapter you are using. If you are using the SimpleTableDataAdapter and SimpleTableHeaderAdapter you can use the setTextSize() method.

  3. saravananraj21 commented on Dec 19, 2018

    @saravananraj21
    Author

    Hi @ISchwarz23.
    I have used SortableTableView and loaded the data using SimpleTableDataAdapter . Can you help me how to sort the table and any sample code for that!

  4. ISchwarz23 commented on Dec 19, 2018

    @ISchwarz23
    Owner

    To make the SortableTableView SortableTableView, you have to set a comparator for each column that should be sortable, by using the SortableTableView#setColumnComparator() method.
    You can find the code of the example app here. But in this example I used domain objects as table data and not string arrays.

  5. saravananraj21 commented on Dec 19, 2018

    @saravananraj21
    Author

    In my case I don't know how many columns and rows of data will be there.I have to set everything dynamically.Is it possible to do that?

  6. saravananraj21 commented on Dec 19, 2018

    @saravananraj21
    Author

    Hi @ISchwarz23
    How to change the text size? I am using SimpleTableDataAdapter and tried to change the size using setTextsize() method but getting error! Please share a sample code.

  7. ISchwarz23 commented on Dec 19, 2018

    @ISchwarz23
    Owner

    Hi @saravananraj21,
    There is not much that can go wrong when setting the text size. Check the API here.
    If the error remains, post the error here.

  8. saravananraj21 commented on Dec 27, 2018

    @saravananraj21
    Author

    Hi @ISchwarz23
    I am getting error when calling the setTextsize().
    error

    error1

    Can you help me regarding this issue!

  9. ISchwarz23 commented on Dec 27, 2018

    @ISchwarz23
    Owner

    Hi,

    this is notan TableView issue. The setTextSize() method returns void. This is why you get this "error". To resolve it, just change your code like this:

    SimpleTableDataAdapter dataAdapter = new SimpleTableDataAdapter(getActivity(), lstrarr_data);
    dataAdapter.setTextSize(10);
    dynamic_grid(lint_i).setDataAdapter(dataAdapter);
  10. saravananraj21 commented on Dec 27, 2018

    @saravananraj21
    Author

    Hi @ISchwarz23
    Thanks! It worked!

    In my case I don't know how many columns and rows of data will be there.I have to set everything dynamically.Is it possible to do that?

    Is there any solution for the above?

  11. ISchwarz23 commented on Dec 27, 2018

    @ISchwarz23
    Owner

    You can add the data to your TableDataAdapter and then trigger a new rendering by calling the notifyDataChanged() method.
    To change the number of columns use the TableColumnModel (like TableColumnWeightModel) and set the number of columns you need using the setColumnCount( int ) method.

  12. saravananraj21 commented on Dec 28, 2018

    @saravananraj21
    Author

    Hi @ISchwarz23
    I have a json array of data to form the table.I need the data to be arranged in the table and the table must be sortable. How can I achieve this using SortableTableView?

  13. ISchwarz23 commented on Dec 28, 2018

    @ISchwarz23
    Owner

    Please read the section about showing custom data and showing sortable data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions