find and replace with jQuery
find and replace with jQuery
hi guys.. i have a question
i have an datatable field with this content (for example)
[code]One | Two | Three | Four | Six | Seven[/code]
now i want to remove with jquery "Three |" with "nothing"
normally i do it with:
[code]$('td').html($('td').html().replace('Three | ', ''));[/code]
You can see a working demo here: http://jsfiddle.net/a8pBG/
but it doesn't work with datatables.
any ideas to realize this?
regards berni
edit:
or another solution i can use
i have only whitespaces between every word.
[code]One Two Four Six Seven[/code]
is it possible to add on column 3 a separator between all whitespaces?
(find " " and replace with " | ")
so my table looks like this
[code]One | Two | Four | Six | Seven[/code]
i have an datatable field with this content (for example)
[code]One | Two | Three | Four | Six | Seven[/code]
now i want to remove with jquery "Three |" with "nothing"
normally i do it with:
[code]$('td').html($('td').html().replace('Three | ', ''));[/code]
You can see a working demo here: http://jsfiddle.net/a8pBG/
but it doesn't work with datatables.
any ideas to realize this?
regards berni
edit:
or another solution i can use
i have only whitespaces between every word.
[code]One Two Four Six Seven[/code]
is it possible to add on column 3 a separator between all whitespaces?
(find " " and replace with " | ")
so my table looks like this
[code]One | Two | Four | Six | Seven[/code]
This discussion has been closed.
Replies
It is a bit of a pain at the moment using fnUpdate for this, but I'll be making the new API a lot more flexible in DataTables 1.10 for this kind of thing.
Allan