Answer the question
In order to leave comments, you need to log in
How to put an object into an array?
A selection is made from the table by key,
$query = Calendar::model()->findByPk($id);
then we need to send it all with AJAX.
echo CJSON::encode($query);
There I get such an unknown garbage:
{id: "17", id_name: "20", date: "2015-09-25", address: "В офисе", company: "1234567", timestart: "",…}
address: "В офисе"
company: "1234567"
date: "2015-09-25"
id: "17"
id_name: "20"
office: "1"
other_info: "test"
timeend: "11:10"
timestart: "12:20"
Answer the question
In order to leave comments, you need to log in
Oh well, try this:
var dataObj = JSON.parse(data);
console.log(dataObj.id);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question