Is there a better way?

Is there a better way?

John HeffJohn Heff Posts: 3Questions: 1Answers: 0

I am using DataTables to present information sourced from the Dom with a lot of links to images in the table.
I am a little concerned about performance. I tried server side processing but my limited knowledge stopped me from creating the links once I had the table populated. You can view the table here
Is there a better way to achieve this result? Any suggestions would be very much appreciated.



This question has accepted answers - jump to:


  • crambldacramblda Posts: 15Questions: 2Answers: 1
    edited September 2015 Answer ✓

    Your performance seems good, are you planning on adding a lot more data?

    I use server-side and need html in my table cells as well. I actually just dump the raw html string in the server-side script that builds the json and it works well. The html in the json has to be all one string, you can't stick new lines on long strings. Make sure to escape any double quotes in the html attributes with a backslash. Here is an example:

        "column1" : "Bob",
        "column2" :  "Smith",
        "column3" :  "<a href=\"http://mysite/images/some-file.png\">See Image</a>"
  • John HeffJohn Heff Posts: 3Questions: 1Answers: 0

    Thank you for your reply. I won't be adding more data to that particular table, although I may have to create one with a lot more data on it.
    I'll give it go and let you know how I get on.

    Regards & Thanks again


  • allanallan Posts: 48,918Questions: 1Answers: 7,133 Site admin
    Answer ✓

    For a DOM sourced table, I think that's probably about as fast as it will go. You could potentially try loading the data either via Ajax or using data to pass in an array of data, at which point you can turn on deferRender, which will help performance a bit, I'd agree with cramblda - the performance seems okay to me.


  • John HeffJohn Heff Posts: 3Questions: 1Answers: 0

    Thanks Allen
    cramblda's suggestion made me realize my mistake.
    I have stuck to the dom sourced data and linked directly to the images on the server rather than loading them in hidden divs.

This discussion has been closed.