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

About sorting #21

Open
JiayangShen opened this issue Sep 9, 2014 · 3 comments
Open

About sorting #21

JiayangShen opened this issue Sep 9, 2014 · 3 comments
Labels

Comments

@JiayangShen
Copy link

If the contents of a column are images, it seems that this column can't be sorted, but, each image has a image id asociated it, and the image id is not suitable for diaplay, but suitable for sorting the image. Is there any method can solve this issue? Thanks for your great work!

@rstaib
Copy link
Owner

rstaib commented Sep 9, 2014

What kind of type is your ID? Is it numeric? If yes, you should tag the affected column with data-converter="numeric" (see here).

@rstaib rstaib added the question label Sep 9, 2014
@JiayangShen
Copy link
Author

The key point of this question is how to uniquely identify a row, about id of a row, and can be access by code freely.

For example, There is a table like this:

Name Age Operation

Jim 20 Edit | Delete
Tom 20 Edit | Delete
Jim 21 Edit | Delete

The data structure is like this:

var persons = [
{ personId: 1, name: 'Jim', Age: 20 },
{ personId: 2, name: 'Tom', Age: 20 },
{ personId: 3, name: 'Jim', Age: 21 }
];

I want to remove a row use the remove() method, I don't want to show checkbox for users to select any row, but have a column "Operation" that can edit or delete a row. Under these conditions, I only have to pass a rowId argumnet to remove() method to remove a row. But I don't know the id of a row. Maybe I can add a column named "personId" to identify each rows, but personId is not suitable for presentation, so I don't want to show this column.

I have a idea but not very sure for my poor javascript skills. That is, if there is a way to config the identifier option of each rows not by the column setting "data-identifier", this issue can be solved. Or, the identifier column can be hide or removed.

Hoping for your solutions!

@rstaib
Copy link
Owner

rstaib commented Sep 10, 2014

Take a look on the Command Buttons Example. There you will find your answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants