I have a classes that,
$.row = {
rowJson:"1",
getRow: function (rowId) {
$.ajax({
type: "POST",
url: "bla bla post link",
data: "{bla bala data}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (dc, status) { $.row.rowJson = JSON.parse(dc.d);},
error: function (request, status) { $.row.rowJson = "-1"; alert(request.responseText) }
});
},
success: function () { if (rowJson == "-1") { return false; } else { return true; } },
Id: function () { return rowJson[0].Id;},
Uygulama: function () { return rowJson[0].Uygulama;},
Kullanici: function () { return rowJson[0].Kullanici;},
Seviye: function () { return rowJson[0].Seviye;},
Durum: function () { return rowJson[0].Durum;},
Baslik: function () { return rowJson[0].Baslik;},
TarihSaat: function () { return rowJson[0].TarihSaat;},
Aciklama: function () { return rowJson[0].Aciklama;},
TalepDurumId: function () { return rowJson[0].TalepDurumId;},
UygulamaId: function () { return rowJson[0].UygulamaId;},
TalepSeviyeId: function () { return rowJson[0].TalepSeviyeId;},
}
after I called like this way,
function _rowInfo(rowId) {
pWaitShow("Please Wait");
$.row.getRow(rowId);
if($.row.success())
{
pWaitHide();
console.log([kbJson,$.row.rowJson])
}
else
{
pWaitHide();
$.ms.standartError();
}
}
Console value is undefined
when I called this function (_rowInfo(5)
) firstly
but console value is real object when I called this function (_rowInfo(5)
) after that firstly called I mean say secondly, thirdly