jquery-tabledit icon indicating copy to clipboard operation
jquery-tabledit copied to clipboard

how i am going to create dropdown on Edit which is listed from DB Table

Open isosio opened this issue 6 years ago • 4 comments

isosio avatar Sep 21 '18 18:09 isosio

i tried below didn't work var athings = '';

$.ajax({ url: "company_data.php" }).done(function(data) { athings = data; dotable();

}).fail(function() { console.log("failed no ali"); athings = '{"1": "Apples", "2": "Beef", "3": "Candy"}'; dotable(); });

function dotable() { $('#editable_table').Tabledit({ url:'masrafsave.php', columns:{ identifier:[0, "id"], editable:[[3, 'no'], [4,'sub', athings ]] }, restoreButton:false, onSuccess:function(data, textStatus, jqXHR) { if(data.action == 'delete') { $('#'+data.id).remove(); } } }); }

});

isosio avatar Sep 21 '18 18:09 isosio

Please let us know if anyone find out the answer for this

yatendra3192 avatar Feb 13 '19 15:02 yatendra3192

I need to create a dropdown menu from the DB as well :(

ManarSh avatar Mar 22 '19 17:03 ManarSh

I got a solution. On each cell that belongs to one column, you set a class like "info-habitant" or what you want. Now when tabledit makes its modifications, you can select that class (which takes all cells with that class). Like this you can append or modify the options of the select with class "tabledit-input". You can update this with AJAX. (Beware that you will have to JSON.parse an array returned from PHP)

THINK "for (data of datas)" $(".info-inhabitant").children(".tabledit-input").append("<option value='" + data["id"] + "'>" + data["name"] + " " + data["familyname"] + "</option>");

ABCarnage avatar Apr 03 '19 12:04 ABCarnage