You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi again. Last changes made my day. Them taken a long time, but already done! So thanks again.
Now about this feature:
I've a table, with normal TDs with some content on'em, text and numbers. Content is inside an <span>.
I've created a JS snipet which on TD-content click, it changes from span to input-text, and let's you alter the content. On blur then, it saves changes on DB, and comes back from input-text to span. Quite tipical nowadays.
Expecting a behaviour like the one exposed on info text:
When you add table rows or whole table from client side, use $.bootstrapSortable({ applyLast: true }) function to add sortability to parts/tables that were not present at document.ready. Use optional paramater applyLast=true if you want to preserve the last used sorting.
I've called the $.bootstrapSortable({applyLast: true, sign: 'reversed'});
But nothing happens. Do not re-sorts the changed row.
So to solve this, I've basically added an snippet on my "from input-text to span" part, which changes the "data-value" from the span parent TD. And after that, I call the $.bootstrapSortable({applyLast: true, sign: 'reversed'}); and then it works.
$(this).parents('td').attr("data-value", $(this).val().toUpperCase()); //fill data-value to re-sort on change.
Question is: is this the normal behaviour? Or it is expected to re-map the TD "data-value" automatically when $.bootstrapSortable({applyLast: true, sign: 'reversed'}); is called?
Thanks and kind regards.
The text was updated successfully, but these errors were encountered:
in this case you are not adding new row, you are just changing content of the cell, but the cell has already set the data-value attribute from the previous state
that's exactly my case. you change content of the cell. but cell has already data-value attributes from previous state. this destroys sorting by clicking headers also. if it's by design probably specify this in documentation? that if you change cell value what you should do? or call bootstrapTable() again. or set data value attribute. is I understand not always will work because you use moment.js on datavalue attribute. probably add method "setCell()" that will set attribute hiding details of implementation from user? thanks in advance )
unfortunately the same attribute is used to predefine the data-value in markup and also to fill the values by plugin
possible solution would be to use separate attributes for predefined values, I will keep this as a possible improvement
Hi again. Last changes made my day. Them taken a long time, but already done! So thanks again.
Now about this feature:
<span>
.Expecting a behaviour like the one exposed on info text:
I've called the
$.bootstrapSortable({applyLast: true, sign: 'reversed'});
But nothing happens. Do not re-sorts the changed row.
So to solve this, I've basically added an snippet on my "from input-text to span" part, which changes the "data-value" from the span parent TD. And after that, I call the
$.bootstrapSortable({applyLast: true, sign: 'reversed'});
and then it works.$(this).parents('td').attr("data-value", $(this).val().toUpperCase()); //fill data-value to re-sort on change.
Question is: is this the normal behaviour? Or it is expected to re-map the TD "data-value" automatically when
$.bootstrapSortable({applyLast: true, sign: 'reversed'});
is called?Thanks and kind regards.
The text was updated successfully, but these errors were encountered: