I have a working grid but need to disable an "add" button on the grid toolbar after posted data is inserted into the grid. To do it, I run a function that gets a recordset from the database and need to parse that JSON to set some local variables.
i know this is simple and really not an issue for the grid itself, but I can't see how to do parse the returned data which looks like:
{"DATA":[{"logins_remaining":0,"login_count":10}]}
The function is called after the grid refreshes. Can you provide a hint on how to parse the JSON?
function refreshLoginCount() {
//get a query recordset of counts from server
$.get("/_resources/cfc/logins.cfc?method=getActiveLoginCount&account_id=" + $account_id, function(data, status){
// This is the response from server >> {"DATA":[{"logins_remaining":0,"login_count":10}]}.
// I want to set some Jquery variables, for example >> $logins_remaining = 0 AND $("#login_count").html("10");
});
}