1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    107
    Vote Rating
    -1
    sencha.user is an unknown quantity at this point

      0  

    Default Checkbox events

    Checkbox events


    Hi,

    I wrote a MySQL query in PHP and sending it to script for displaying it in the grid.

    What I am trying now is, I have fields and a checkbox for it in a grid, can I check one and set that as a column for another grid like,

    Code:
    var columns = [{text: "All Fields", sortable: true, width: 100, dataIndex: 'selected_field'}];
    And I have to send request back to PHP so that it will have,

    Code:
    SELECT selected_field FROM table
    Thanks.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,010
    Vote Rating
    460
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      1  

    Default


    You could use the checkchange event to issue an AJAX call..
    http://docs.sencha.com/ext-js/4-1/#!...nt-checkchange

    or assign it to a button.

    Scott.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    107
    Vote Rating
    -1
    sencha.user is an unknown quantity at this point

      0  

    Default


    Hi Scott,

    Thanks very much for the reply. I think that will help for my requirement, let me see to that and get back.

  4. #4
    Sencha User
    Join Date
    Jul 2012
    Posts
    107
    Vote Rating
    -1
    sencha.user is an unknown quantity at this point

      0  

    Default


    Hi,

    Can someone tell me how to send request to PHP from script?

    I will set dataIndex in the script and I need to tell that value to PHP, for example, if I am setting dataIndex of a grid to id, I have to dynamically set that "id" in PHP like,

    Code:
    SELECT id FROM table_name
    How can I do that?

    Thanks.

  5. #5
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,010
    Vote Rating
    460
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      1  

    Default


    You can make a simple ajax call:

    Code:
    Ext.Ajax.request({
    	url: 'update.php',
    	params: {
    		id: '1'
    	},
    	success: function(xhr) {
    	},
    	failure: function() {
    	}
    });
    Scott

  6. #6
    Sencha User
    Join Date
    Jul 2012
    Posts
    107
    Vote Rating
    -1
    sencha.user is an unknown quantity at this point

      0  

    Default


    Hi Scott,

    Thanks, so that will send request to PHP? That will solve my problem .

    Code:
    var selModel = Ext.create('Ext.selection.CheckboxModel', {
            listeners: {
                selectionchange: function(sm, selections) {
                    alert("Selected");
                }
            }
        });
    I have the above code for checkbox, where does the "checked" box value gets scored? I want to set that value in the dataIndex of another grid.

    Thanks in advance .

  7. #7
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,010
    Vote Rating
    460
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    You can check the grid SM:
    Code:
    grid.getSelectionModel().getSelection()
    Scott

Thread Participants: 1