DataTable in Visualforce

DataTable in Visualforce

batson456batson456 Posts: 4Questions: 0Answers: 0
edited April 2014 in General
I know this might be a little bit of a tricky question to ask, but I am not sure where else to go. When using the datatables plugin in Salesforce, I am using a wrapper class to wrap all of my data and provide a boolean attribute for record selection using checkboxes. This portion of it works fine from the presentation layer, and all records appear selected or not selected appropriately. However, when I click the button to actually commit the records to the database, only the records that are currently visible in the table are actually committed. All records included in any other table page not currently visible are considered not selected and are treated as such when committing. I don't know if anyone has any experience with this plugin with Salesforce, or just any suggestions in general. I can post code if requested.

Replies

  • batson456batson456 Posts: 4Questions: 0Answers: 0
    I am sorry to not provide any test cases, but the only environments I can link to require special login permissions.
  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin
    Have a look at this example: http://datatables.net/release-datatables/examples/api/form.html .

    Allan
  • batson456batson456 Posts: 4Questions: 0Answers: 0
    Thank you so much for the reply. I do not believe that solution will work however, as the processing of the form is actually handled through an Ajax method provided by Salesforce which I do not have override access to. The only solution I have been able to think of is to use the datable destroy method after clicking the action button but before submitting the form but this causes a flash of unstyled content until the page rerenders.
  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin
    Other option would be to pull the input elements into a hidden div in the form, which the browser can then use in the submission.

    Allan
  • batson456batson456 Posts: 4Questions: 0Answers: 0
    This worked, thank you so much Allan. I am sure you have heard this before, but tremendous plugin! One of the best I have had the privilege of using.
  • jonathanwieseljonathanwiesel Posts: 5Questions: 1Answers: 0

    Could you please explain some more how to solve this issue?

    I'm kind of stuck with these scenario, actually the same as this:

    http://salesforce.stackexchange.com/questions/21871/how-to-submit-all-wrapper-class-records-using-datatables-net-jquery-plugin-ape

This discussion has been closed.