HTML tags are removed , when searching/filtering

HTML tags are removed , when searching/filtering

rakesh91rakesh91 Posts: 8Questions: 2Answers: 0
edited January 2015 in Free community support

Hey guys, i am using datatable for my project.Now for so many days i am stuck on an issue.
List that am getting is having content in html format,means it includes images,all styles.At first time everything looks good ,, when datatable is initialised,but when we do any filtering, all HTML tags are striped, only text /string is left.

I want to maintain that styles (HTML tags )and images ...please provide me any solution for this...

This question has an accepted answers - jump to answer

Answers

  • rakesh91rakesh91 Posts: 8Questions: 2Answers: 0

    allan, does dis issue has a solution or not ???

  • mRendermRender Posts: 151Questions: 26Answers: 13

    Can you provide the code that you're running so we can provide help to you? Please see the sticky forum which provides the rules of this forum. Thank you.

  • rakesh91rakesh91 Posts: 8Questions: 2Answers: 0
    edited January 2015

    Thanks MOdgility for reply . Actually i am using alphabet search like this http://www.datatables.net/blog/2014-08-26 . Everything works fine ,but content inside table is encoded in html tags.

    SUppose COntent in starts with a is like <div>akfjfvjkv <b> hello </b> </div>.Initially wen table loads this b tags are shown.When we click on 'B' and come to 'A', those html tags are striped ...this is the prob i am facing ...

  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin
    Answer ✓

    So you want to be able to click on d and get your div tag? Unusual! But what you should be able to do is use the columns.type option and set it to be string. That will stop DataTables striping the HTML for sorting and filtering. I'm not sure I've come across a request for that before :-)

    Allan

  • rakesh91rakesh91 Posts: 8Questions: 2Answers: 0

    hey allan , i got the ans .i made a mistake ... thanks for ur reply :)

This discussion has been closed.