Click here to Skip to main content
14,366,562 members
Rate this:
Please Sign up or sign in to vote.
hello,
i want to pass my array data to may datable data and the data don't want to displya this is my code

the data look like this
{
__proto__	{...}	Object
		CodePostaleConstruction	"38260"	String
		CodeProgramme	"01000"	String
		HorodatageCreation	null	Null
		HorodatageModification	null	Null
		HorodatageSuppression	null	Null
		IdMembreCreation	null	Null
		IdMembreModification	null	Null
		IdMembreSuppression	null	Null
+		JsonObject	{...}	Object
		JsonObjectString	""	String
		LibelleMembreCreation	null	Null
		LibelleMembreModification	null	Null
		LibelleMembreSuppression	null	Null
		LibelleProgramme	"AB /  LA COTE SAINT ANDRE"	String
		sHorodatageModification	""	String
		Ville	"LA COTE ST ANDRE"	String
}


What I have tried:

var loadProgrammeImmobilier = function (searchCodeProgramme, searchLieu) {
    // programmeImmobilier

    $.ajax({
        type: 'GET',
        url: 'http://localhost:xxxx/api/Programme/RecupererToutProgramme',
        data: {
            "searchCodeProgramme": searchCodeProgramme,
            "searchLieu": searchLieu
        },
        contentType: 'application/json; charset=utf-8',
        success: function (data) {

            var myData;
            for (var i = 0; i < data.Item.length; i++) {
                myData = data.Item[i];
            }
          
            $('#programmeImmobilierTable').DataTable({
                data: myData,
                dataSrc : '',
                columns: [
               { data: "CodeProgramme" },
               { data: "LibelleProgramme" },
               { data: "CodePostaleConstruction" }
                ]
            });
                //});
            
        },
        error: function (data) {
            alert(data);
                 }
    });
};
Posted
Updated 15-Oct-19 6:13am
v2
Comments
Ehsan Sajjad 10-Mar-17 15:07pm
   
have a look here :https://www.codeproject.com/Articles/1118363/GridView-with-Server-Side-Filtering-Sorting-and-Pa
Ehsan Sajjad 10-Mar-17 15:08pm
   
and here : https://www.codeproject.com/Articles/1114208/Beginners-Guide-for-Creating-GridView-in-ASP-NET-M
[no name] 15-Oct-19 11:13am
   
Please use the code tags when posting code. I've edited your question and added them for you...
Dave Kreskowiak 15-Oct-19 14:46pm
   
You're only 2 years too late. The OP hasn't posted anything since.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100