Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting new feature #356

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions js/src/treegrid/doc/dataconnector.html
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,15 @@ <h3><a name="Columns" id="Columns"></a>Columns</h3>
Sorting must be supported by the used DataConnector.</td>
</tr>

<tr>
<td>sortableType</td>
<td>String</td>
<td>no</td>
<td>
Sort the record based on the "sortableType" option that header column passed. The default value would be "string". supported value would be "date"
</td>
</tr>

</table>

<p>
Expand Down
17 changes: 9 additions & 8 deletions js/src/treegrid/examples/example15_sorting.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,27 @@
// Called when the page is loaded
function drawTreeGrid() {
var tableData = [
{name: 'Klaas', age: '25', city: 'Rotterdam', hobbies: 'Computer games'},
{name: 'Johan', age: '28', city: 'Groningen', hobbies: 'Reading'},
{name: 'Kees', age: '22', city: 'Amsterdam', hobbies: 'None'},
{name: 'Christine', age: '31', city: 'Rotterdam', hobbies: 'Movies'},
{name: 'Bart', age: '23', city: 'Utrecht', hobbies: 'Going out'},
{name: 'Silvia', age: '26', city: 'Den Haag', hobbies: 'Shopping'}
{name: 'Klaas', age: '25', city: 'Rotterdam', hobbies: 'Computer games', dateEnter: '20 Nov, 2015'},
{name: 'Johan', age: '28', city: 'Groningen', hobbies: 'Reading', dateEnter: '19 Sep, 2014'},
{name: 'Kees', age: '22', city: 'Amsterdam', hobbies: 'None', dateEnter: '18 Sep, 2014'},
{name: 'Christine', age: '31', city: 'Rotterdam', hobbies: 'Movies', dateEnter: '1 Jan, 2013'},
{name: 'Bart', age: '23', city: 'Utrecht', hobbies: 'Going out', dateEnter: '30 Nov, 2015'},
{name: 'Silvia', age: '26', city: 'Den Haag', hobbies: 'Shopping', dateEnter: '15 Feb, 2015'}
];
var tableOptions = {
columns: [
{name: 'name', text: 'Name', sortable: true},
{name: 'age', text: 'Age', sortable: true},
{name: 'city', text: 'City', sortable: true},
{name: 'hobbies', text: 'Hobbies', sortable: false}
{name: 'hobbies', text: 'Hobbies', sortable: false},
{name: 'dateEnter', text: 'Time entering city', sortable: true, sortableType: 'date'}
]
};
data = new links.DataTable(tableData, tableOptions);

// specify options
var options = {
width: '500px',
width: '700px',
height: '400px'
};

Expand Down
Loading