How to bind checkbox dynamically into the table my json datat formate is given as ..

How to bind checkbox dynamically into the table my json datat formate is given as ..

Abdul_KhalilAbdul_Khalil Posts: 7Questions: 3Answers: 0

{"aaData":[{"RoleID":"2fcd1049-d14c-4e23-aff4-5b311fd142b1","FormID":"82ef2f9b-3b47-405b-ab3e-124184540aa4","CanAdd":false,"CanEdit":false,"CanDelete":false,"CanView":true,"Name":"City Creation","Description":"Create City","url":"Master/City/Index","Id":"fe51fc51-31de-4ba5-9288-7f90861e28d3","LoggedInUser":null,"IsActive":false,"ReturnResult":null},{"RoleID":"2fcd1049-d14c-4e23-aff4-5b311fd142b1","FormID":"fe36a3f0-0026-41bf-bfc4-2bf265e76afb","CanAdd":true,"CanEdit":false,"CanDelete":true,"CanView":false,"Name":"Franchise Details","Description":"Details of Franchise","url":"Master/Franchise/Index","Id":"64f39d25-9355-411c-8bd0-d5ae25b0c54d","LoggedInUser":null,"IsActive":false,"ReturnResult":null},{"RoleID":"2fcd1049-d14c-4e23-aff4-5b311fd142b1","FormID":"83b8e57d-4c74-4732-a938-488f95764288","CanAdd":false,"CanEdit":true,"CanDelete":false,"CanView":false,"Name":"Role Creation","Description":"Create Role","url":"Master/Role/Index","Id":"118b8789-8505-4409-9f13-769f1302bee9","LoggedInUser":null,"IsActive":false,"ReturnResult":null},{"RoleID":"2fcd1049-d14c-4e23-aff4-5b311fd142b1","FormID":"72aa9a80-1523-456e-8cbc-5cd370e9d677","CanAdd":true,"CanEdit":false,"CanDelete":true,"CanView":false,"Name":"User Creation","Description":"Create Users","url":"Master/User/Index","Id":"78573ec8-fa1e-4a56-a2e2-0e0298d297ee","LoggedInUser":null,"IsActive":false,"ReturnResult":null}]}

Answers

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    Format

  • Abdul_KhalilAbdul_Khalil Posts: 7Questions: 3Answers: 0

    thanks jLinux...
    I solved it by own ..

    "columns": [
    { "data": "Name", "orderable": true },
    { "data": "Description", "orderable": true },
    { "data": "url", "orderable": true },
    {
    "data": "CanAdd",
    "render": function (data, type, row) {
    if (data === true) {
    return '<input type=\"checkbox\" id=\"chkadd\" checked value="true">';
    }
    else {
    return '<input type=\"checkbox\" id=\"chkadd\" >';
    }

                    },
    
                },
    
  • jLinuxjLinux Posts: 981Questions: 73Answers: 75
    edited November 2015

    I wish you could solve how to use the format :-D Below the text box you type, it has instructions

    And I typically don't take the time to be of much help in threads where it seems like the OP didn't put much thought or time into the post itself, regarding detail, syntax, formatting, etc etc. I kinda feel "If they don't care to try and make it easier to help, why should I make it easy by helping". I know im not the only one, so just a friendly recommendation, format your posts and give more detail than the one sentence in the subject.. :)

This discussion has been closed.