Skip to content

Drag and Drop Sorting Grid for Titanium

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE.txt
Notifications You must be signed in to change notification settings

adampax/TiSortable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deprecation Notice

10/12/15 -- This library is very old and no longer maintained.

Sortable Grid View for Titanium

Sortable. Movable. Drag and Droppable.

Make a sortable grid using Titanium controls. Inspired by various Q&A posts. Uses Pedro Enrique's excellent TiDraggable module.

Use

Require the CommonJS module

var SortableView = require('/path/to/SortableView');

Add some cell views to an array that will be passed to the SortableView

var data = [];

for (var i = 0; i < 9; i++){
    var v = Ti.UI.createView({
        backgroundColor: '#cdcdcd'
    });
    v.add(Ti.UI.createLabel({
        text: 'Cell ' + (i+1),
        color: '#3f3f3f',
        font:{
        	fontSize:16,
        	fontWeight:'bold'
        }
    }));
    data.push(v);	
}

Create the SortableView and pass it the cell data

var view = new SortableView({
    data: data, //array of views
    cellWidth: 100,
    cellHeight: 100,
    columnPadding: 5, //Space in between two columns
    rowPadding: 5, //Space in between two rows
    columns: 3 //Number of columns		
});

All Properties

  • data: array of views that will become the cells in your list/grid
  • cellWidth/cellHeight: size of cell in pixels
  • columnPadding: Space between columns
  • rowPadding: Space between rows
  • columns: Number of columns

Todos

  • Write the todos list

License

Copyright (c) 2013 Adam Paxton - Polanco Media, LLC
http://github.com/adampax/TiSortable
Licensed under the MIT License. See License.txt

About

Drag and Drop Sorting Grid for Titanium

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published