EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: thecyberzone on February 02, 2015, 02:44:30 AM



Title: Updating a table row from a datagrid row
Post by: thecyberzone 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.


Title: Re: Updating a table row from a datagrid row
Post by: stworthy 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>


Title: Re: Updating a table row from a datagrid row
Post by: thecyberzone 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.