jQWidgets Forums

jQuery UI Widgets Forums Grid Usage of selectionmode as checkbox

Tagged: ,

This topic contains 5 replies, has 2 voices, and was last updated by  C.S.Putera 11 years, 9 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • Usage of selectionmode as checkbox #28935

    C.S.Putera
    Participant

    Hello. Please help. This is the case :

    I’d like to set and show items related with a box, using jqxgrid, where user can choose items for that box from the list in the grid.

    E.g

    Box : A
    Items :

    [grid here]

    I am using json as the datasource and have set the selectionmode : ‘checkbox’. I have set also the id as the name of my column, id : ‘delivery_confirmation_id’, but the checkbox still does not appear.

    1. Is there another setting that I have to do to show the checkbox ?
    2. Is there any example of how to use json as datasource, and set the checkbox. Also after selecting the row, getting the id selected.
    3. When a page load, I’d like to set the checkbox as checked, which value ( either checked or not ) is taken from the database query ( If item is already related to that box, then set as checked, otherwise set as unchecked )

    Please help. Thank you very much

    Usage of selectionmode as checkbox #28936

    Peter Stoev
    Keymaster

    Hi C.S.Putera,

    Please, look at the following sample with Checkbox selection: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/checkboxselection.htm?arctic. To select a row through the API, use the “selectrow” method and pass a bound index as parameter.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Usage of selectionmode as checkbox #28940

    C.S.Putera
    Participant

    Thank you for the reply. Yes, I had seen the example before and already follow the guidelines :

    1. Set the id of the row. In my case id : ‘delivery_confirmation_id’
    2. Set the selectionmode. In my case selectionmode : ‘checkbox’

    But the checkbox does not show up. Is there another setting I should do ?

    I set the rows as the root => root : ‘rows’ ( instead of “entry” like the example ) and did not set the record: “content”. Should I set the record to “content” ? And If I should, what is that for ?

    Thank you

    Usage of selectionmode as checkbox #28941

    Peter Stoev
    Keymaster

    Hi C.S.Putera,

    If the checkbox is not displayed, the possible reasons are:

    1. You use an old version.
    2. You do not have reference to jqxcheckbox.js in your code.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Usage of selectionmode as checkbox #28954

    C.S.Putera
    Participant

    OMG, you are right. I checked the “view page source” on my chrome and the file is still pointing to the old file.
    I cleared the cache and it works well. Thank you

    But I haven’t got solution of how to retrieve the id of the selected row. I found method ‘.on(“rowselect”)’ :

    $("#gridId").on("rowselect", function(e){
    alert(e.args.rowindex);
    });

    But it only retrieve the index of the row which is not what I need. Could you please tell me how to retrieve the id ? Thank you

    Usage of selectionmode as checkbox #28962

    C.S.Putera
    Participant

    Hello. I’ve got the solution of how to retrieve the id of the selected row. But now how to set the row as selected when I load the box data ? “selectrow” would not be appropriate since I do not know the index of the row, nor how to pass the id of the saved row to set the row as checked on page load. Please help. Thank you

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

You must be logged in to reply to this topic.