jQuery UI Widgets Forums Grid custom key, value dropdown.

This topic contains 5 replies, has 2 voices, and was last updated by  vicky 8 years, 5 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • custom key, value dropdown. #79558

    vicky
    Participant

    Hello,

    i am stuck at when showing custom key, value in dropdown when values coming from database. How can i convert those in key value.

    Regards,
    Vikash Thakur

    custom key, value dropdown. #79564

    Dimitar
    Participant

    Hello Vikash Thakur,

    Please take a look at the demo Keys/Values Column. We hope it is helpful to you.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    custom key, value dropdown. #79566

    vicky
    Participant

    Hello Dimitar,

    Thanks for quick response.

    How to handle when values coming from database. do i need to send different request to database for dropdown?

    Regards,
    Vikash Thakur

    • This reply was modified 8 years, 5 months ago by  vicky.
    • This reply was modified 8 years, 5 months ago by  vicky.
    custom key, value dropdown. #79570

    vicky
    Participant

    Actually values coming from database are keys only and they are appending on cells in row. if value is coming ‘C’ from database then i want to show ‘Client’ on frontend, if value is ‘U’ then value must be ‘User’.

    custom key, value dropdown. #79571

    Dimitar
    Participant

    Hi Vikash Thakur,

    You can achieve this with cellsrenderer, e.g.:

    var cellsrenderer = function(row, columnfield, value, defaulthtml, columnproperties) {
        if (value === 'C') {
            return '<span style="margin: 4px; float: ' + columnproperties.cellsalign + ';">Client</span>';
        } else if (value === 'U') {
            return '<span style="margin: 4px; float: ' + columnproperties.cellsalign + ';">User</span>';
        }
    }

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    custom key, value dropdown. #79623

    vicky
    Participant

    Hello Dimiter,

    Thanks for your response. it’s working fine.

    Regards,
    Vikash Thakur

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.