how to get the real data from the datasource?

how to get the real data from the datasource?

dj_sumaoy14dj_sumaoy14 Posts: 9Questions: 0Answers: 0
edited July 2012 in General
i use fnRender in one column of my grid
ex. i convert one data to a checkbox and setting the data as the value of checkbox

so when i use fnGetData(tr)

the return object or data was the checkbox and not the real data

any workaround?

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    If you are using fnRender and you want to not use the rendered value for the data, then you can use the bUseRendered property to disable that.

    Allan
  • dj_sumaoy14dj_sumaoy14 Posts: 9Questions: 0Answers: 0
    sorry allan but i don't think bUseRendered is working in version 1.9.

    i tried to use mDataProp and it work's fine but another problem is when i try to sort the column it results to an error because the param mDataProp_0 pass the word "function"

    this is the code in my config for one of the columns

    mDataProp: function(s, t, v) {
    return t === "display" ? (s.status === "A" ? "Active" : "Ceased") : s.status;
    },

    any workaround?
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    bUseRendered works well in 1.9.2 (all unit tests are passing), but given that you say this:

    > mDataProp_0

    I'm going to presume that you are using server-side processing. Is that correct?

    If so, then bUseRendered has no effect since filtering and sorting are done on the server... mDataProp_{i} is given as 'function' if you have it as a function in server-side processing since the Javascript function is fairly useless at the server.

    Allan
  • erikcwerikcw Posts: 6Questions: 1Answers: 0
    I have a similar setup. I'm using server-side processing, but relying the value of mDataProp_0 for a field name to sort the database on server side.

    I want to display a marked up value in the table (just adding a link to another page). But I also need to send the "main" field name for that column in mDataProp_0 so I can sort properly.

    Is there a workaround for this?
  • erikcwerikcw Posts: 6Questions: 1Answers: 0
    It seems that using mRender for marking up the cell, and mData pointed to the property in the json object does the trick.
This discussion has been closed.