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
How to add an ID to the "tr" ? #119
Comments
Sorry, I do not quite understand what use add ID to the tr class. |
the ID supposed is hidden and not appear as column. generally when using 'bootstrap-table' what is the best method, to get/set the recordID from/to row? thanks |
hmmm, is cute wenzhixin :) #HTML - on table ID column# <th data-field="cust_id" data-visible="false">
Item ID
</th> #After table initialization# $('#customers_tbl').on('click-row.bs.table', function (e, row, $element) {
//here the hidden column is readable :)
console.log(row.cust_id);
}); [edit] data-click-to-select="true" data-single-select="true" but is anyway to hide the checkbox column? when I set the data-visible=false to checkbox column weird things happened! |
I think it is no need to set a ID to the tr element, because you can get the id by row data. |
Hello ! In fact, I'm using personnal ID ... It's for that I need to set a personnal ID for each "tr" ... |
There is no possibility to add a class or ID in each tr ot td ? |
You can use Docs: http://wenzhixin.net.cn/p/bootstrap-table/docs/documentation.html |
I'm sorry ... i'm a novice in code... xD How to use For example, I have this table
I want to had
Thank you and sorry for my stupid question ... :( |
function rowStyle(row, index) {
return {
classes: 'personal_ID' + row.ID
};
} |
No way to do that only with attribute in html ? because my problem is that I autocomplete my table with Symfony Twig with an array... like that :
Is that why I can't use Javascript to do that... I directly complete Table with Twig... :( |
I love very much your plugin ! But it miss that... could add some ID or CLASS directly with attribute in HTML... not just with JAVASCRIPT because in my case it's not adapted ... and finaly I can't add ID or classes ... |
Hi, I am glad that you like this plugin. If I have time I will consider to support this feature (without writing any JavaScript code, and without using json url) next version. You can star or watch this repo to follow the updates. Reference to issue #123. |
Great ! good job :) |
Hi ! Just for know... In how many time you think you can do this ? |
Saved all |
You are a Dude ! Now your API is almost perect ;o) thanks a lot :) |
^_^ |
Hello, after some tests, I can't use this... I have always the automatics " data-index " ... and when I put some ID or class directly in HTML, they don't appear :( ... why ? thanks |
Yes I saw that but It strange... doesn't work for me ... |
Can you provide jsFiddle code? |
Here it is : :o) |
I think you need to update the code from src/bootstrap-table.js |
I have this :
|
humm ... ok lol ... I look better in my side !! thanks for your help ! |
It's OK now :) I don't know why but the code wasn't updated ... I'm using BowerComponnent from Synfony2... and it did'nt work ... |
Would be perfect to also keep all data-* attributes. I think you should be using instead of but that is not possible at the moment. |
How to set this ID from a URL source? Agree with Sopamo - keep all data-* attributes will be good - and set them all from JSON |
OK, I will consider that feature. Added as a new issue. |
Hello,
How can I do that please ?
In Symfony Twig I tried that :
But the class not appear in my html... why ?
The text was updated successfully, but these errors were encountered: