bosko

Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • bosko
    Participant

    This was fast Smile

    in reply to: ‘Virtual’ data mode #101620
    bosko
    Participant

    Of course. I didn't try to do that. I just tried to use function for name through variable as you suggested but result is the same – sort will not work in that case.

    in reply to: ‘Virtual’ data mode #101618
    bosko
    Participant

    I agree with you that simple solutions are the best one in most cases but unfortunatelly it seems this is not the case here. This solution also cross my mind and I tried it but with same result.

    Looks like grid cannot work in 'virtual mode'. Problem is in a way header cell is constructed. Namely for element id it uses 'name' value from colModel which returns function code even if it is used in proposed way.

    <th id='"+ts.p.id+"_"+ts.p.colModel.name....

    Best regards,

    Bosko

    in reply to: ‘Virtual’ data mode #101616
    bosko
    Participant

    Hello,

    I thought also that index property might help but it didn't. Seems like problem (at least for sorting) is in fact that when function is used for column name column id is set to source of function (actually substring of it). Later on in click handler there is comparision:

    this.name === tid

    which compares name (function in this case) and id which is string equal to substring of function source. Reproducing this is easy. Just in any sample put name to be function. Part of my code is:

    colModel: [

    { name: function(obj) {

    if (total) {

    return obj.values.weight;

    } else {

    return obj.values.weight * totalNumber;

    }

    }, index: “calories”, label: “Weight”, width: 78, align: “right”, firstsortorder: 'desc', sorttype: “float” }

    ]

    Best regards,

    Bosko

Viewing 4 replies - 1 through 4 (of 4 total)

Stay connected with us in your favorite flavor!