Solve the problem that the time value is empty when the Layui batch pass value is in the background operation.

解决layui批量传值到后台操作时出现传值为空的问题

As shown, the front desk, DATA parameters are

[{“good_id”: 1, “good_name”: “Standard – Total Phosphor”, “Good_Num”: “BY400014”, “PID”: 10, “First_PID”: 1, “Good_standard”: “1.46mg / L”, “Good_cas”: “:” 7220-81-7 “” Good_SPE “:” 1ml “,” Normal_Price “:” 500.00 “,” Good_stock “:” 322 “,” Good_indate “:” 1600876800 “,” Cash_sale “:” 1 “,” good_url ” : “/ uploads / 20190923 / eaa8577dd76344a3ed15cc3ca0146a50.jpg”, “company”: “TMstandard”, “good_sort”: 99, “good_new”: 1, “good_promotion”: 1, “create_time”: “1569222082”}, { “good_id “: 2,” good_name “:” Determination of acetyl “in water in water,” GOOD_NUM “:” BW20040-100-W-20 “,” PID “: 14,” first_pid “: 2,” Good_Standard “:” 100mg / L “,” good_cas “:” 50-00-0 “,” Good_SPE “:” 20ml “,” Normal_price “:” 90.00 “,” Good_stock “:” 280 “,” Good_indate “:” 1630512000: “1630512000 “,” cash_sale “:” 1 “,” good_url “:” / uploads / 20190923 / 8CA481784CC15EE27399E754D788AAD1.JPg “,” Company “:” GOOD_SORT “: 99,” Good_New “: 1,” Good_Promotion “: 1,” Create_Time “:”}]
   
Probably, it is necessary to delete two records, and then death can’t pass the value to the background. It is undefined to return to the back, and the card is a morning !!!

Finally solved After

, you can get the value of the password {“ID”: [“1”, “2”]}, of course, here JSON_ENCODE does JSON is handled

VAR Data = Checkstatus.Data; var ID = new array (); // Here there is a small episode, when you create an empty array, you must use Array, Array will report an error, cry, the foundation is not strong. Console. LOG (JSON.STRINGIFY (DATA)); for (var i in data) {id [i] = data [i] .good_id;} $ .ajax ({url: ‘”, // background controller TYPE:’ POST ‘, Data: {‘ ID ‘: ID}, DataType:’ JSON ‘, SUCCESS: Function (MSG) {Console.log (MSG);}});
   
The problem with the above-mentioned value-in-the-time, the problem is that the Layui batch passage value is the full content of Xiaobian sharing, I hope to give you a reference, I hope everyone will support Tumi Cloud.

© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment