TouchTreeGrid now supports Standard Grids and Accordions with single Expand
TouchTreeGrid is an extremely versatile and easy to implement Sencha Touch 2.1x custom component that supports Tree Grids, Standard Grids and traditional Accordion view layouts (all by the same component). Column sorting and custom data renderings such as comma formatting, currency, percents and custom colors for negative vs. positive values are included. TouchTreeGrid utilizes Sencha’s Ext.dataview.List component and Disclosure events are supported for leafs and optionally for category rows.
TouchTreeGrid was developed entirely within Sencha Architect (v2.2) designer product and can also be used without Architect. An Architect component is provided for import into your toolbox (TouchTreeGrid.xdc). Using Sencha Architect you can implement this component for new grid implementations very rapidly. Both basic and advanced examples are included in the download. Scrolling and overall functionality was found to be very fast for a larger data example containing +3000 rows and 3 category levels. This software can be downloaded at https://github.com/swluken/TouchTreeGrid along with comprehensive documentation and is free to use (refer to associated MIT.LISCENSE) .
TouchTreeGrid upgraded for Touch 2.2
TouchTreeGrid component and examples upgraded to Touch 2.2 in download directory TouchTreeGrid_Advanced_220. Refer to ChangeLog.txt for details. Also included is example of PullRefresh implementation to use latestfetched event in lieu of deprecated refreshFn.
https://github.com/swluken/TouchTreeGrid
TouchTreeGrid component for Touch 2.2
Hi,
TouchTreeGrid.xdc in the "TouchTreeGrid_Advanced_220" directory is the Touch 2.2 version. I created it using most recent Architect Version: 2.2.2 Build: 971 and just now tested importing it into my toolbox and dragging ontoView within Project Inspector. My Architect Library path is: http://cdn.sencha.com/touch/sencha-touch-2.2.0/.
Note TouchTreeGrid.xdc in "TouchTreeGrid_Advanced_21" and "TouchTreeGrid_Basic_21" directories is the Touch 2.1 version (also created using same version of Architect).
Let me know if I am missing something.
Regards,
Steve
2 Attachment(s)
TouchTreeGrid: Grouper and Horizontal Scrolling Examples
TouchTreeGrid enhanced (2.1x and 2.2x versions) to support
column sorting within "grouped" rows for simple lists.
Enhancements to support Horizontal scrolliing also implemented.
All component changes are backward compatible to prior versions.
Added Touch 2.2 examples (also work for 2.1):
- Added zebra row striping to "Basic" DOW History example
- Added simple list example with grouped rows and custom grouper text
(column sorting within each group)
- Added simple list example for horizontal scrolling
Download available at: https://market.sencha.com/extensions/touchtreegrid
or https://github.com/swluken/TouchTreeGrid
Attachment 43791Attachment 43792
Implementing TouchTreeGrid in New Project
Steve,
Thank you for creating this component. I've been looking for ways to use grids in sencha architect and was having trouble with putting the touchgrid version.
I wanted to ask you how what steps I need to take to use it? I saw the info on the help, and basically did the following:
1. Create a new Touch 2.2 Project.
2. Added the TouchTreeGrid.
3. Added a Panel.
4. Linked the TouchTreeGrid to the Panel.
5. Set the Store in the Link with the following data:
[
{name:'Sample 1', category:'Category 1', type:'Type 1'},
{name:'Sample 1', category:'Category 1', type:'Type 1'},
{name:'Sample 1', category:'Category 1', type:'Type 1'},
{name:'Sample 1', category:'Category 1', type:'Type 1'},
{name:'Sample 1', category:'Category 1', type:'Type 1'},
{name:'Sample 1', category:'Category 1', type:'Type 1'},
{name:'Sample 1', category:'Category 1', type:'Type 1'},
{name:'Sample 1', category:'Category 1', type:'Type 1'},
{name:'Sample 1', category:'Category 1', type:'Type 1'}
]
6. Added columns in the Link with the following:
[
{header:'name',dataIndex:'name',width:'25%'},
{header:'category',dataIndex:'category',width:'25%'},
]
7. Copied Resources to the project, and now get this error:
Uncaught TypeError: Object #<Object> has no method 'setItemTpl' TouchTreeGrid.js:551
Any clues?
Row selection in TreeGrid
Hi,
Row selection of expanded 'leaf' rows is supported by setting configs:
disableSelection: false
mode: 'MULTI' (if you want to support multi-selection)
Side effect is that the expandable category row, when selected, will also show the selected CSS colors by default. That should be avoidable via CSS .. I'll play with it and get an example out there if I get it working.
I'm currently working on some cool new features with examples and will post in next couple of days. One of the new features is to disable expand/collapse when you want to show a fixed expanded list. There might then be more of a need for highlighted row selection of the "disabled" category row.
Best regards,
Steve
1 Attachment(s)
Multiple Enhancements and new Examples
Attachment 44140
NEW FEATURES AND EXAMPLES
- Customizable column shading when clicking on header column to sort ASC/DESC.
(Example: Lists => Basic Horiz and Dynamic)
- Example how to dynamically define Grid Columns, create Store and load data
from single AJAX server call in less than 40 lines of code.
(Example: Lists => Dynamic)
- Example of custom styled multi-row header
(Example: Lists => Horiz and Dynamic)
- Example how to trap tap event on any cell within a grid
(Example: Lists => Horiz -and- Dynamic ... tap on CloseDate cell for sample popup)
- Examples of how to implement CSS for row selection for 3 different scenarios:
1) Row selection for simple lists
(Example: Lists => Basic)
2) Row selection for TreeGrid leafs plus nodes also demonstrating new config where
expand/collapse feature can be disabled (disableExpandCollapse=true config).
(Example: Tasks => Tasks#2)
3) Row selection for TreeGrid leafs (only) where disableExpandCollapse=true and
scrolling is disabled (i.e. known list sizes)
(Example: Tasks => Tasks#3)
- Support option to define different column layouts/widths/contents for
Category rows vs. Detail rows (TreeGrids). Essentially implementing
expandable/collapsible "grouper" feature with TreeGrid allowing for
custom long text on category row.
(Example: Lists => Grouper2 ... Touch 2.1 example only for now)
- Example of custom expand/collapse controller function for large treestore to circumvent performance issues with Touch Node expand/collapse methods -or- to support server-side column sorting.
(Example: Lists => Grouper#2)
- All new examples found in ./TouchTreeGrid_Advanced_22/ directory.
Refer to "TouchTreeGrid - documentation.pdf" (Summary of Provided Examples) in download for further discussion on each of the examples.
OTHER NEW FEATURES:
- Config to control column width of expand/collapse arrow (default is 4% but 2% would
suffice for tablet implementations)
- More developer control over column styling (refer to CommitLog.txt in download)
- Providing source code on how to generate TreeStore from "unioned" JSON flat file containing ID and PARENT_ID columns. Refer to "TouchTreeGrid - Documenation.pdf"[Lists => Grouper#2 -TreeGrid serving ‘grouper’ feature with expand/collapse] for details on use.
- Cleaned up example code to be more readable
- Significant documentation updates to "TouchTreeGrid - Documentation.pdf"
Source code found at: https://github.com/swluken/TouchTreeGrid
Refer to CommitLog.txt for important upgrade steps to prior versions.
Refer to "Appendix C - Upgrading TouchTreeGrid component" in
"TouchTreeGrid - Documentation.pdf" for how to upgrade your
component within Architect.
1 Attachment(s)
TouchTreeGrid for Slide Navigation + TreeStore Filtering
Attachment 44391
NEW FEATURES AND EXAMPLES
- New set of examples that utilize TouchTreeGrid component as
Accordion Slide Navigation Menu (i.e. Facebook style menu, but collapsible)
for Phones and as scrolling collapsible category menu for Tablets.
** Refer to directory ./TTG_Slider/. in download (Touch 2.2)
> All menu items easily defined in store
> Scrolling navigation menu with spring disabled such that user
can not scroll past top or bottom of list.
- Example of easy to implement TreeStore filter solution. There are a few
forum threads suggesting Sencha does not correctly support TreeStore filtering for
Touch or EXTJS. This example utilizes provided TreeStore generation algorithm
to rebuild TreeStore from saved array applying custom filter conditions.
> Census Filter Ex#1
(refer to "TouchTreeGrid - Documentation.pdf" for this example).
- Examples of embedded images within grid cells
> Sliding Menu => PNG file displayed on Category rows
> Project Tree Examples => Project #3 displays checkmarks
(Slide Navigation example only)
- Example of leaf row rendering function using styleContentRow config:
> Project Tree Examples => Project #3 rows shaded green where done
> Use styleCategRow config to style category rows
- Example of cell rendering function using CSS selector as opposed to Styles (Basic List #2).
Allows red/green cells to display as white text with blue background when selected.
- Added logic to differentiate handling of list disclose event vs. item tap as
tap of new Touch 2.2 disclosure icon triggers both events causing category rows
to expand/collapse when disclose event was intended.
- Added logic to not allow expand/collapse of specific node if expandable=false
for store defined node.
- Support optional column[] array CLS references in lieu of Styles. Example:
cls, sortedCls, categCls, categSortedCls, headerCls, headerSortedCls
instead of (or in addition to) existing style equivalents:
style, styleSorted, categStyle, categStyleSorted, headerStyle, headerStyleSorted
> Lists => Dynamic
Refer to ./data/dow2012dynamicCss.json for css-based column definitions
- Support different CSS selectors for each category level.
Default selector is ".touchtreegrid-list-categ". New config categCssArr[]
allows for specification of different CSS selectors for each level in same
way that categColorArr[] allows for basic color shading.
> Projects => Ex #2
> First category level in white italics using custom selector for that level.
Remaining levels use default selector.
- Corrected implementation of Grouper #2 example to work in Touch 2.2
Issue found was that in 2.2 you can't use same Model for Store and a TreeStore
(else you will observe strange behaviour when bouncing between two views
configured as such)
- All new Slider Menu examples found in ./TTG_Slider/ directory.
Refer to "TouchTreeGrid - documentation.pdf" (Summary of Provided Examples) in download for
further discussion on each of the examples.
- "TouchTreeGrid - Documentation.pdf" updated for new examples and Slider Menu implementation.
Refer to CommitLog.txt for update summary.
Refer to "Appendix C - Upgrading TouchTreeGrid component" in
"TouchTreeGrid - Documentation.pdf" for how to upgrade your
component within Architect.
PLANNED ENHANCEMENTS:
- Column sorting within TreeGrid categories.
- Multi-column sorting feature
- Support initially sorted shading feature
- Column show/hide/add/update example with accompaning methods
- More renderer function examples
- Easy config options to auto-add buttons to footer to "auto-display" different sets of columns
(or provide methods for custom buttons)
- Support for editable cells
- Possible support for locked columns
- Seeking interest on supporting config option to use Ext.dataview.DataView vs. Ext.dataview.List
Horizontal scrolling issue
Thanks for the report. I removed "height: 1000" config from the examples and updated GITHUB repository.
Tip when building simple tests in Architect
For those trying to build simple tests of TouchTreeGrid within Architect, be sure not to mark TouchTreeGrid as your Initial View.
"Notes on Implementation" and "Basic Features" sections in "TouchTreeGrid - Documentation.pdf" discusses minimum configurations to get started.
Use a Store for simpleList=true and TreeStore only when you want to do non-simple lists.
You have to include TouchTreeGrid.css for default styling. SimpleLists will not render horizontally correctly without including this file. Any CSS overrides should be made in a second CSS file loaded "after" this one similar to the provided examples.
Pull Refresh / Pagination with Accordion List
Let me say that it is just awesome plugin .I am trying to add the Accordion functionality to my new project, Its working fine..
I have large no of data. So my doubt is ,can i include Listpaging or PullRefresh plugin along with this Accordion.
Can u have any example about how to do that..Please suggest how such functionality included with Accordion..Your help is much appreciated..Thanks in advance
ListPlugin and ListPaging
Hi,
Project, Ex#1 is example that uses PullRefresh. It fires the new Touch 2.2 latestfetched event to the controller which reloads the data. Note refreshFn method is no longer supported in 2.2. Lists, Basic #1 example also uses PullRefresh and the data refresh is handled by the store. This is also covered under "Advanced Features" in "TouchTreeGrid - Documentation.pdf"
I haven't used the ListPaging plugin yet. I would expect it to work for simple list examples same as any other list. You will probably need to be more creative if needed for TreeGrid/Accordion examples. One strategy for really large trees is to only load the top nodes first, then load child nodes as needed. I found this EXTJS example that might be of use for doing that: http://www.mysamplecode.com/2012/02/...let-mysql.html
Note that Census example contains 400k of data (600 rows across 28 data elements) which sometimes will timeout within 10 seconds when loading on slower network (3G), but otherwise there is no issue scrolling the data on the devices I have tested. I have also tested a 3000 row example with no issue.
One exception is that expand/collapse ALL on the 600 and 3000 row treegrid examples was slow when using Sencha's expand/collapse methods provided with NodeInterface component (which is what TouchTreeGrid uses by default). For these cases I found it faster to reload the treestore expanded to desired level using the provided treestore generation algorithm. Similar to TTG_Slider Census Filter example, but without the filter function passed (refer to CensusController.js, methods onCensusFilterExpandButtonTap() and onCensusFilterCollapseButtonTap()). You will also need to use customExpCollapseEvent config provided with TouchTreeGrid. Refer also to "Advanced Features" section in the documentation.
Best regards,
Steve
TouchTreeGrid Integration
Hi ,
I am trying to integrate TouchTreeGrid (Census Type Grid) in one of my sample project . I am able to create the basic sample using "Notes on Implementation" section in "TouchTreeGrid Documentation.pdf". But when i tried the Advanced sample, i got an error in loadCensusMaine2000Store function, exception is happening in the following line in chrome debugger Console
var gridcont = me.getCensusmaine();
the exception messgae i got is
Uncaught TypeError: Object [object Object] has no method 'getCensusmaine'
but there is no definition found for 'getCensusmaine' in the sample project. I am very new to Sencha Touch 2 , Please help.
Thanks in advance
Arun
TouchTreeGrid Enhancements
Summary: Minor updates to better support Dynamic grids and individual cell taps.
GITHUB Repository: https://github.com/swluken/TouchTreeGrid
(refer to README.md file for demo links)
*** MODIFICATIONS THAT REQUIRE UPDATES TO PRIOR IMPLEMENTATIONS ***
No configuration updates required. All changes are backward compatible to prior release.
*** ENHANCEMENTS TO TOUCH 2.2x TOUCHTREEGRID VERSION COMPONENT (2.1x version not updated) ***
- updateStore() method modified to auto-create temporary store if not defined within configuration for purposes of supporting dynamic grids without requiring creation and reference to temporary store.
- updateColumns() method updated to add 'dataIndex = "column name"' attribute to each cell DIV if columns[] array has newly supported addDataIndexToDiv=true config for that column. This inserts unique identifier for each cell DIV and allows for processing of unique cell tap (same method for how header cell tap works). Tap on CloseDate and ClosePrice columns for Horizontal scrolling and Dynamic grid examples.
- Refer to documentation "Lists => Horiz (DOW History Example with Horizontal Scrolling" (Program Flow section) on how to simulate a hyperlink sub-string within the text of a specific cell.
- Documentation updated per above. Refer to "Appendix C - Upgrading TouchTreeGrid component" in "TouchTreeGrid - Documentation.pdf" for how to upgrade your component within Architect.
PLANNED ENHANCEMENTS:
- Column sorting within TreeGrid categories.
- Multi-column sorting feature
- Support initially sorted shading feature
- Column show/hide/add/update example with accompaning methods
- More renderer function examples
- Easy config options to auto-add buttons to footer to "auto-display" different sets of columns (or provide methods for custom buttons)
- Support for editable cells
- Possible support for locked columns
- Seeking interest on supporting config option to use Ext.dataview.DataView vs. Ext.dataview.List
contentItemTplOverride error
Hi,
following on from the last post ..tried your example as in the doco with changing the contentItemTplOverride:
Code:
contentItemTplOverride: '<div style="background-color: white; padding-left: 2em; font-size: 1.2em;">{text}</div>'
and get an error
Code:
Uncaught TypeError: Object [object Object] has no method 'setContentItemTpl'
this is using the basic Architect project TouchTreeGrid_Basic_21
and occurs in the function updateColumns at the line
Code:
varcontent=me.setContentItemTpl(detail);
3rd time lucky with the checkboxes
Hi,
my bad...contentItemTplOverride working fine.
Used part of your code and threw in some of mine:
Code:
<div style="background-color: white; padding-left: 2em; font-size: 1.2em;">{text}<span style="float:right;padding-right:2em"><input type="checkbox" name="chk{index}" checked>{index}</span></div>
Works perfectly...of course the index refers to the list item index which starts at 0 for each level but if I include a unique id for each item that should solfve it.
Then I can do a document.getElementsByName('chk'+{index})[0] to find out whether it is checked or not.
Thanks for putting this out.
Does TouchTreeGrid supports Drag and Drop
Hi Steve,
I am currently working on Sencha Touch 2 components, can TouchTreeGrid supports Drag and drop from another Sencha Touch 2 components or panels?
Thanks.
When will support for editable cells be ready?
Hi Steve,
you planned to enhance TouchTreeGrid to support for editable cells, may I know when will the enhancement be release?
TouchTreeGrid Enhancements
Sencha just announced new Touch Grid component for their 2.3 release (late August) and I just saw a presentation of it by the developer here at SenchaCon. We should all be gravitating to that assuming it meets our needs. Hence, I'm going to spend some time with the new grid component before making anymore enhancements to the simple list features of TouchTreeGrid. However, having spoken with Sencha Touch team members I don't get the sense we are going to see treegrid functionality in the near future, but it is planned. Given that, I intend to continue to support and enhance treegrid and accordion features supported by TouchTreeGrid until Sencha implements this functionality. Also note I've been told Sencha only plans to make the new Grid available to those who have purchased one of the bundles.
I would be curious to know how drag/drop for treegrids (as opposed to simple lists) would be used. Regarding cell editting, I will likely implement that, but don't have a timeline yet. With vacations coming up it might be a bit longer before I get the next release out.
Best regards,
Steve
TreeStore to use ajax proxy
Hi there
Firstly, thanks for this awesome component!
I am trying to get it to work using an ajax proxy (or jsonp proxy) for the TreeStore. I have your basic task example & trying to load the exact data from the example via a json proxy (tried via server & local json).
I have tried various techniques & measures to get it to load.
I have verified that the remote store loads fine, testing with the Sencha nested list component.
Using the exact same store for the basic TouchTreeGrid displays an empty list.
I have tried to hack the common controller to explicitly load the store - but my Sencha knowledge is not sufficient to make sense of what is going on. Ideally it would be great if the dynamic store worked as seamlessly as a store with inline data does.
Here is the modifed TouchTreeGrid.store.Task store config with the proxy:
config: {
autoLoad: true, // have tried with this set to true + false to try trigger the updateStore function
model: 'TouchTreeGrid.model.Task',
storeId: 'TaskStore',
proxy: {
type: 'ajax',
url: './data/task.json',
reader: {
type: 'json',
rootProperty: "items"
}
}}
Any help would be much appreciated, I've been hacking at this for about 2 days.
2 Attachment(s)
TouchTreeGrid Enhancements to support CalendarPicker component
NEW FEATURES AND EXAMPLES
- Download: https://github.com/swluken/TouchTreeGrid
- Modifications to support IE10
- Created 2.2 Basic version (./TouchTreeGrid_Basic_22/*.* files) which includes
appChrome29fix.html to run on Chrome 29+ (uses ChromeFix.css instead of
Sencha library CSS file)
- Modifications to support new CalendarPicker component. Demonstrates several new
capabilities with TouchTreeGrid including:
- Images in header/footer toolbar, in category rows and in individual cells
(see Christmas Calendar example)
- Gradients in Category rows
- Pass custom object defining custom items/buttons to add to auto-generated footer
toolbar
- Hide expand/collapse buttons, but show custom buttons
- Dock footer toolbar containing expand/collapse + custom buttons to top
(i.e. above column headers)
- All new Calendar Picker examples found in ./CalendarPicker/ directory.
Refer to "CalendarPicker.pdf" in download for further discussion of supported features.
Related Forum Posting: http://www.sencha.com/forum/showthre...cker-Component
- "TouchTreeGrid - Documentation.pdf" updated for new configs.
See working CategoryPicker Demo:
http://www.gomainerentals.com/Sencha...icker/app.html
Refer to CommitLog.txt for update summary.
Refer to "Appendix C - Upgrading TouchTreeGrid component" in
"TouchTreeGrid - Documentation.pdf" for how to upgrade your
component within Architect. BE SURE TO ALSO UPDATE TOUCHTREEGRID.CSS !!
PLANNED ENHANCEMENTS TO TouchTreeGrid:
- Column sorting within TreeGrid categories.
- Multi-column sorting feature
- Support initially sorted shading feature
- Option for single-Accordion select mode to sort currently selected category to top.
- Column show/hide/add/update example with accompaning methods
- More renderer function examples
- Animated expand/collapse
- Possible support for editable cells
- Possible support for locked columns
- Possible support for drag/drop
- Seeking interest on supporting config option to use Ext.dataview.DataView vs. Ext.dataview.List
PLANNED ENHANCEMENTS TO CalendarPicker:
- More examples including IPhone-style calendar layout
- Method+button to allow user to add more months to displayed calendar
- Auto-generation of re-occuring custom dates with descriptions (i.e. anniverseries, birthdates, meetings, etc)
- Day Planner support
- Feature to expand/collapse months using user-defined Function
- Horizontal scrolling calendars
- Speed up Expand All/ Collapse All for large calendars.
- Optional categorize by Year feature.
- Soliciting other good ideas to integrate with this component