jquery-bootgrid
jquery-bootgrid copied to clipboard
Status Mapping Docs
Absolutely no idea how to implement this. What status data is this evaluating? You're docs leave a lot to be desired.
+1 for more demos of the new features.
Hi,
I agree with you, the documentation needs to be more explicit ^^
I found a way to implement it and it's works but I don't know if it's the official way.
Anyway, you have just to call your server with a response containing 'status' data :
$a_json_row["status"] = 0; // success row
$a_json_row["status"] = 1; // info row
$a_json_row["status"] = 2; // warning row
$a_json_row["status"] = 3; // error row
Remember, you need bootgrid 1.2 minimum.
The statusMappings allows you to add or edit the status classes.
Can you elaborate further, are you returning this status from the server to bootgrid and if so how are you implementing it's use on in the browser?
Thanks
Has there been an answer regarding this?
I can shed some light.
In your SQL results, return a column "status" with a numeric status 0 -> 3 which will map to the docs accordingly.
You can then setup your mapping:
statusMapping: {
0: "",
1: "danger"
},
In my case, I'm returning a boolean field from postgres, casting it to an integer and then overriding the type defined for "1" to "danger" so that bootstrap color class is used.
HTH
Any way to do this with pre-existing html table? Or is it only work for json data?