EasyUI Forum
September 13, 2025, 12:17:32 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Updating a table row from a datagrid row  (Read 8349 times)
thecyberzone
Full Member
***
Posts: 176



View Profile Email
« on: February 02, 2015, 02:44:30 AM »

Is there any event like onBlurRow where I can call php (by using $.get()) to update the underlying table ?

What I have done that there is a checkbox column exists in row to select the row, so I have used onSelect as well as onUnselect event to fire $.get(). Is there any standard event like onBlur or please show me a way to extend datagrid to make a customized onBlur event of row.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: February 02, 2015, 04:04:44 AM »

The datagrid row has not 'blur' event since it can not be focused. Of course, you can extend your own row events for the datagrid. The code below shows how to bind the 'mousedown' event to the datagrid rows.
Code:
<script>
$.extend($.fn.datagrid.defaults.rowEvents,{
    mousedown: function(e){
        console.log('mousedown')
    }
})
</script>
Logged
thecyberzone
Full Member
***
Posts: 176



View Profile Email
« Reply #2 on: February 02, 2015, 06:58:14 AM »

Thanks for your reply and for showing an easy method to extent any custom event.

What I have done, my datagrid is also having a checkbox column used for select/unselecting a row. Just I have put my saving row code in onSelect as well as in onUnselect event, just I have passed the checkbox field final's value as 'Y' in onSelect event and 'N' in onUnselect event, rest of the field value remains same.

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!