-
Notifications
You must be signed in to change notification settings - Fork 102
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
FEATURE REQUEST - Select rows in DataTable using checkboxes #1038
Comments
The other day, one of our users used the |
BTW, I think we won't implement the feature. Instead, we'll add the walk-through to the documentation. |
To expand the datatable with selectable checkboxes, you have to do following configuration: 1.) Download the JavaScript File „dataTables.checkboxes.min.js“ Example: customOptions="pagingType:'full_numbers',
'columnDefs': [{'targets':0, 'checkboxes': {'selectRow': true}}],
'select':{'style':'multi'}" „0“ in the 'targets': parameter means that the first column of the datatable will be the checkbox-column. If you set it to „1“ it will be the second column and so on. The checkbox column must have a unique ID in the datatable. <b:dataTableColumn label="test" id="checkboxDT" >#{resultList.id}</b:dataTableColumn> |
@stephanrauh I'm curious... Why would this not be implemented in the future? It's nice to be able to incorporate it into BootsFaces, but the walkthrough @frankyhoffmann shared seems to suggest using strict jQuery. The nice thing about using BootsFaces framework is so we wouldn't have to try to come up with a variety of functions to get the feature. I think the current selection isn't 100% user friendly because there still are some users who doesn't know about ctrl- and shift-clicking. And using a non-framework-implemented table makes the table non-responsive. I really like using BootsFaces because it implements Bootstrap's responsive CSS. Please reconsider and add this as a new feature. |
Note to be added to the walkthrough : For anyone who wants to use the plugin in an other language than English, it doesn't uses the b:datatables lang option so you have to manually set the language.
The languages.rows sets the message "xx row selected" but it also override the lang="yourLang" in the b:datatable. So you need to specify your language again.... Even if the feature is not included in BF it might be nice to see if we can't for the lang option to work with it. |
@Lb-lea I've read your original post (GitHub kindly sends me an email each time someone opens or adds to an issue), and it convinced me. No idea why the plugin breaks the internationalization. I'll have a look at it. Integrating the feature to the BootsFaces library also shifts the responsibility to us, but maybe it's simpler to make every plugin work together if they're part of the core library. |
…tion-mode="multiple">`
…tion-mode="multiple">`
…tion-mode="multiple">`
@frankyhoffmann @Lb-lea I've added the feature to BootsFaces, but it seems I didn't get it right yet. For some reason, the message below the table always reports "1 row selected", never "2 rows selected". Any idea what I'm doing wrong? |
…tion-mode="single">`
…tion-mode="single">`
Now it works! The feature supports both |
@stephanrauh, I think this is broken in 1.4.1 It shows as numbers instead of checkboxes in the documentations. https://showcase.bootsfaces.net/forms/DataTable.jsf#selectioncolumn |
Oops - it's broken in the showcase, but works on my machine. Looks like a forgotten JavaScript file. |
Missing imports: <link type="text/css" rel="stylesheet" href="/BootsFacesWeb/javax.faces.resource/css/dataTables.checkboxes.css.jsf?ln=bsf">
<script type="text/javascript" src="/BootsFacesWeb/javax.faces.resource/js/dataTables.checkboxes.min.js.jsf?ln=bsf"></script> |
…t` and `pull-left`
This feature is going to ship with BootsFaces 1.4.2. |
Can we have feature of selecting rows using checkboxes in next release? This is helpful since it is more user-friendly and doesn't require someone to hold ctrl or shift. Moreover, it will be helpful for mobile users as well as it's more intuitive.
For Example : Primefaces Datatable
The text was updated successfully, but these errors were encountered: