Giter VIP home page Giter VIP logo

tableview's Introduction

tableview

tableview for Jquery Mobile

Demo: tableview

version 0.3 - based on JQM 1.3.0 (March 2013)

####New features 0.3

  • added refresh method. Call $( your table ).table("refresh")
  • data-override="true" disables the default JQM filter
  • fixed multi row header not correctly toggling

####How to use
As JQM now supports tables, this version of tableview is hacked into the current JQM widgets. To use it, you just need to replace the following files:

##JS
tables.js
table.columntoggle.js
table.reflow.js listview.filter.js (optional if you want to use the filter on tables, too)

##CSS
jquery.mobile.table.columntoggle.css
jquery.mobile.table.css

With the files provided in the repo you can still use both column-toggle and reflow mode in tables. Both should continue to work normally.

In addition the widgets allow to do the following:

1. Multiple header rows
Currently only working when the split header cells are at the end of the table (still need to fix this).

2. Added options
The widgets add the following options to a table:

data-sortable="true" [set on table header cell, default: undefined]
Declare this on a header cell to convert the cell into a button (arrow-up/down). There is no functionality on the button. You will have to add this yourself.

data-filter="true" [set on table: default: null]
This will add a table row filter to the table. To use it, you need to replace the listview.filter widget with the filterview widget, which can be used for both tables and listviews.

data-popup-theme [set on table: default: c]
Set a theme to the popup.

data-button-popup-theme [set on table, default: c]
Set a theme to checkboxes inside the popup.

data-popup-btn-icon [set on table, default: gear]
Set a icon for the popup button.

data-popup-btn-iconpos [set on table, default: left]
Set the iconpos of the popup button.

data-header [set on table, default: "c"]
Set a theme for the table header.

data-wrapper [set on table, default: "a"]
Set a theme for the table top and bottom containers.

data-top/bottom-container [set on table, default: null]
Add a top and or bottom container to the table. This is placed before the table and by default has 3 grids you can add buttons to.

data-top/bottom-grid [set on table, default: 3]
Set the number of grids you want in the top and bottom container (up to 5 grids).

data-slot-id [set on sibling select/button]
Set a number to move this element into the top/bottom container. Tested with selects and buttons.

data-create [set on table, default: undefined]
If you specify a value of false, JQM will NOT add markup to the table. This is useful if you want to generate finished code on the server or if you are rendering widgets yourself on the client. All event bindings will be set, but no extra markup is generated.

The following features can be used with the filter widget:

data-relate [set on different table or listview]
This allows to "connect" different listviews or tables. For example you could use a panel with a listview & filter and have another listview in the main section ( products, icons....). Specifying data-relate on the 2nd listview/table will make the filter work for both widgets, so you can filter two datasets with a single filter.

data-filter-slot [set on table]
This will move the filter to the slot specified in the top or bottom container. I will modify this to make this more generic, so you can place the filter where ever you want.

data-override [0.3 set on table]
Setting this parameter will disable the filter completely (vs. customFilterCallback using the filter but with custom logic. Use this if you want to update the table or listview with dynamic data.

tableview's People

Contributors

frequent avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tableview's Issues

Multiple columntoggle tables with top container in the same page.

Multiple columntoggle tables with top container and search enabled in the same page result in all column buttons located in the 3rd slot of the first table, although search fields are located correctly (jqm 1.3.1)

Found out that the problem goes away if i change line 16 of table.columntoggle.js from:

$.mobile.table.prototype.options.slot = 3;

to

$.mobile.table.prototype.options.slot = 0;

datatables

How add dataatbles withs u tabs ?

like csv export ?

Sorting in your demo doesnt seem to work

First, thanks for your great work, especially this plugin that i would like to use as i need to use tables on a responsive web app using jqm.

i saw that jqm is on the way to 1.4 and that filterbar should be a widget but we dont know when 1.4 will be out.

In the demo, sorting didnt work for me, just me ?

I want to use the column toggle tableview and have about 1000 rows to treat (maybe i wont need 1000 at first load, but i should be able to have the one i want using the filter, maybe before any display. I have several questions :

  • have you thought about a lazy load ?
  • have you planned a pagination widget

my easy solution is to use your plugin with the filter widget you added and according to this filter, display all relevant rows.

thanks for cooperation !

Using the files in the repository

Hi Sven,

I have spent some time trying to use the files in this repository but with no luck. I get the "define is not defined error" although I am importing the table.js after jQuery and jQuery mobile. I am using latest mobile 1.3 final and jquery 1.9.1. How can I use those files? From what I understand you have merged the examples into latest.js, which is 1.3 beta, and not final.

Please let me know whether I can simply copy paste the code from individual files, i.e. table.js into the final 1.3 mobile and then minify it.

Thanks ahead,

Ilya

Get selected row in tableview

tablewview,js looks very nice, but how can I get the index of the row which was selected with a checkbox?

Is it possible to get the data in this row by cell?

How to migrate existing pages

I really love your widget... I used it with jqm 1.2. I know you explained how to use the latest version with jqm 1.3, but I confess that I don't understand the instructions for how to use it...

Your example page loads a file called "latest" but that seems to be the jqm file. For chowderheads like me, could you explain which files to include in the head of the document, and the order in which to include them if that's critical?

Also: your instructions suggested that one need only "replace" certain files to use the widget, but those files are... where exactly? I downloaded the zip of the repo... some of the listed files were not there: I'll assume "tables.js" refers to "table.js"... but there's nothing even close to "jquery.mobile.table.columntoggle.css" . I don't see listview.filter.js either, though there is "tableview.filter.js and filterview.js They're not in the example.... and I've tried several permutations to see if could get your demo page to work (not the one in the main folder of the repo, the one in the example folder that refers to files called "latest") loading the files in the repo, but I get errors (using firefox / firebug). I'm also at a loss about what to do with the json file and the jquery file.

Anyway... you'd be helping me be able to upgrade to 1.,3... if you'd show a generic example head section with the necessary files, including the jqm CDN files. Sorry to be so dense....

Any way to split out jquery so it isn't hacked into the jqm framework?

I like what you've started with the tableview, although I don't want to replace or change the jqm framework because with every upgrade of jqm I would have redo the changes for this functionality. Right now I opted to use the FooTable plugin for sorting, filtering and a responsive design but I really like the column toggle feature of jqm. Is there any way to split out the changes you made to the framework?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.