I have to filter the rows by resource wise and hide the empty rows.
I need to do it in both ways.I mean when check hide empty rows if any of the resource is selected at that time.
I have to show only rows with that resource and hide empty.
Please take a look at this tutorial:
You'll need to adjust the logic in onRowFilter event handler to use your criteria.