Page 5 of 5 FirstFirst ... 345
Results 41 to 48 of 48

Thread: Visible Checkbox in EditorGrid

  1. #41

    Default Submitting changes php mysql

    Hey All,

    Great example to implement some single click checkboxes!
    However, I'm unsure how to push the update to my db?

    I've tried utilizing the afteredit function, but I don't think it fires.

    Can anyone lend a hand?

    Thanks
    -Nick

  2. #42
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    Quote Originally Posted by nromanel View Post
    Hey All,

    Great example to implement some single click checkboxes!
    However, I'm unsure how to push the update to my db?

    I've tried utilizing the afteredit function, but I don't think it fires.

    Can anyone lend a hand?

    Thanks
    -Nick
    if you're referring to the example i wrote, then the afteredit event never fires on the checkbox column because the ColumnModel definition for that particular column has the editable config set to false.

    how are you sending all of your grid info to the backend?

  3. #43

    Default

    What I ended up doing was making an AJAX call from the listener event. Works fine for my purposes!

  4. #44

    Default

    I'm using Ext 2.0 and this seems to work alright as long as I don't click on the checkbox image itself. If I click in the empty cell around the image then cellclick fires, if I click on the image then cellclick never fires.

    Am I missing something here?

  5. #45
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    Quote Originally Posted by Tefen View Post
    I'm using Ext 2.0 and this seems to work alright as long as I don't click on the checkbox image itself. If I click in the empty cell around the image then cellclick fires, if I click on the image then cellclick never fires.

    Am I missing something here?
    you don't actually need this override for 2.0.

    check out the EditorGrid example for 2.0:
    http://extjs.com/deploy/dev/examples...edit-grid.html

    and the associated js file on how it's done:
    http://extjs.com/deploy/dev/examples/grid/edit-grid.js

  6. #46

    Default

    I was able to get a checkbox on my grid using the code from the EditorGrid example but I am having trouble with it firing the afteredit event. If I edit one of my other fields, I see the red corner and then it fires the event. When I check or uncheck the check box it shows the red corner but does not fire the event. Any ideas on why it does not fire the event even though it appears that it is detecting the change? Thanks!

  7. #47
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    nothing extraordinary comes to mind.

    post your code.

  8. #48
    Sencha Premium Member kimosabi's Avatar
    Join Date
    Jan 2008
    Location
    Perth, Western Australia
    Posts
    54

    Default

    Quote Originally Posted by a2b2c2d View Post
    I was able to get a checkbox on my grid using the code from the EditorGrid example but I am having trouble with it firing the afteredit event. If I edit one of my other fields, I see the red corner and then it fires the event. When I check or uncheck the check box it shows the red corner but does not fire the event. Any ideas on why it does not fire the event even though it appears that it is detecting the change? Thanks!
    Ok I had the same problem and found this solution on this post.
    http://extjs.com/forum/showthread.php?t=27161

    Code:
    this.on('cellclick',function(o, row, cell, e) {
    	// ensure mouseclick occurred within checkbox icon's visible area
    	if (o.getColumnModel().getDataIndex(cell) == 'indoor' && e.getTarget('.checkbox', 1)) {
    		var rec = o.getStore().data.items[row];
    		rec.set('indoor', !rec.get('indoor')); // toggle "indoor" value
    		o.fireEvent('afterEdit', {
    			grid: o,
    			record: rec,
    			field: 'indoor',
    			value: rec.get('indoor'),
    			originalValue: !rec.get('indoor'),
    			row: row,
    			column: cell
    			});
    
    		}});
    Hope this helps

Page 5 of 5 FirstFirst ... 345

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •