Code Monkey home page Code Monkey logo

Comments (2)

Holt59 avatar Holt59 commented on August 19, 2024

Hello,

If I understood you correctly, what you want to do is send a completely new set of data to the datatable?

Did you check the return value of jq1_11_1('#tblResults').datatable('select', 1) ?

When calling the datatable contrusctor, you should use « data » not « insert » to reset the current set of data - If you don't, the plugin uses the current values in the HTML table, which, in your case, are the old entries.

from datatable.

FifthCloud avatar FifthCloud commented on August 19, 2024

Thank you for responding so soon. I did not want to search for another tool as this project I am working on is coming to a close. Your paging tool is sweet.

Your suggestion is exactly what I was going for. This is what I did per your recommendation.

Code:
try {
if(jq1_11_1('#tblResults').datatable('select', 1) == null)
{
jq1_11_1('#tblResults').datatable('destroy');
}
//data: tableData,
jq1_11_1('#tblResults').datatable({
data: tableData,
pageSize: 50,
sort: [true, true, true, true, true, true, true, true, true, true, false, true, true, false, false, true],
filters: ['select', true, 'select', 'select', 'select', true, 'select', 'select', 'select', true, false, true, true, false, false, true],
filterText: 'Type to filter... '
}) ;
}
catch(err) {
jq1_11_1('#tblResults').datatable({
data: tableData,
pageSize: 50,
sort: [true, true, true, true, true, true, true, true, true, true, false, true, true, false, false, true],
filters: ['select', true, 'select', 'select', 'select', true, 'select', 'select', 'select', true, false, true, true, false, false, true],
filterText: 'Type to filter... '
}) ;
}

If something exists within the select statement I then use the "destroy" command to make it seem like the results keeps "refreshing". It works wonderfully!

I am closing this issue as its fixed! Thanks again! Sweet tool.

Edit: I just realized something. I make it seem like this tool was actually broken, but I just want to clarify I didn't know what commands to use to get me what I needed. The paging tool works just fine. But if I may make a suggestion that the documentation could be updated a bit to say that destroy works well with data and not insert. That's all. Thanks again!

from datatable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.