Using JQuery DataTables, can I pass a javascript array as a data source but still using server-side paging

Here is my code:

								window.InHousePropertiesListVar = $('#inhouseproperties').DataTable( {
									"searching": false,
									"processing": true,
									"serverSide": true,
									responsive: true,
									"ajax": window.AjaxListPreURL + "&source=1&" + $('#searchPropertiesForm').serialize(),
									"fnDrawCallback": function () {
									'oLanguage': { 'sEmptyTable': "No Properties Found Matching Your Criteria" }
									//"scrollY": "100%",
									//"dom": "frtiS",
									//"deferRender": true
								} );

Open in new window

I have multiple Data Tables and would like to only make one call..

I wanted to do something like this and process the 2 data sources on the client side

$output[a] = SSP::complex(....);
$output[b] = SSP::complex(....);

echo json_encode($output);

Open in new window

Please advise, thanks.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

greetings  Mark, ,  I do not understand what you may mean by -
        "pass a javascript array as a data source but still using server-side paging",
the Jquery dataTable has a "paging" process already built in, you set up your FULL data rows in the AJAX sendback, and then have a ROW amount to display, and it pages the full ROWS to the amount set to display.

The ajax return for a datatable can be adjusted, but, each datatable AJAX is usually meant for just ONE table, and you say - "I have multiple Data Tables and would like to only make one call", it might be easiest to use the default datatable AJAX (one table per ajax), and do several different ajax address returns for each table.

and alternative is to do your own AJAX and have -
        $output[a] = SSP::complex(....);
        $output[c] = SSP::complex(....);
        echo json_encode($output);

then you set your datatable to use "local data variable" in the AJAX return and NOT in the JQUERY window load function, and you can then set the datatable data source to an object in your AJAX received. But this is not so easy to do.
MarkProgrammerAuthor Commented:
That's what i'm looking to do .. I want to set the data source to an object while still using server-side paging, etc.

The paging/sorting data from each table will have prepended names to the variables so my server-side script knows which "SSP::complex" it should be applied to
As I said, there are things for datatables, that can be done for some "Alternate" ways to set the "data" option, you might look at this example -

see the code line -
   "data": dataSet,

this uses an ARRAY , not an object for the "data" ,and requires the column "titles" to be set. But you can also do objects.

Can you see how you can get an array back from your server by your AJAX, and not use the datatable AJAX at all, and then set the table rows with Your Ajax return.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.