jquery-bootgrid icon indicating copy to clipboard operation
jquery-bootgrid copied to clipboard

Status Mapping Docs

Open HarveyEV opened this issue 8 years ago • 5 comments

Your 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.

HarveyEV avatar Oct 27 '15 13:10 HarveyEV

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.

moradrouaguy avatar Dec 04 '15 13:12 moradrouaguy

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

bellwood avatar Jun 15 '17 17:06 bellwood

Has there been an answer regarding this?

Andrewthedev avatar Dec 01 '17 18:12 Andrewthedev

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

bellwood avatar Dec 04 '17 19:12 bellwood

Any way to do this with pre-existing html table? Or is it only work for json data?

jamespsterling avatar Jun 22 '18 22:06 jamespsterling