Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
deepthi narendula
Related To Delete Functionality
January 10, 2013 8:54 PM
Answer

deepthi narendula

Rank: Junior Member

Posts: 39

Join Date: April 26, 2012

Recent Posts

Hi Friends,

I am using jquery and ajax call for deleting record in database,I am able to delete the record from database it is deleting at backend but at front end my searches were not deleting,how to do it please help me out.

Thanks&Regards,
N.Deepthi.
Juhi Kumari
RE: Related To Delete Functionality
January 10, 2013 10:30 PM
Answer

Juhi Kumari

Rank: Expert

Posts: 347

Join Date: December 12, 2011

Recent Posts

Hi,
You can do it using jQuery.
1<td><a  class="modify-link" href="javascript: ;"
2                                    onclick="jQuery(this).trigger('change'); Liferay.SearchContainer.get('<portlet:namespace />dalagateTable').deleteRow(this, <%= holiday.getHolidayId() %>);
3                                        <portlet:namespace />removeDelegate(<%= holiday.getHolidayId() %>)">
4                                    <%= removeRoleIcon %></a></td>


and js method
 1var <portlet:namespace />holidayIds = ['<%= ListUtil.toString(holidayList, "holidayId", "', '") %>'];
 2    function <portlet:namespace />removeDelegate(id){
 3        for (var i = 0; i < <portlet:namespace />holidayIds.length; i++) {
 4            if(<portlet:namespace />holidayIds[i] == id){
 5                <portlet:namespace />holidayIds.splice(i, 1);
 6                break;
 7            }
 8        }
 9        document.<portlet:namespace />fm.<portlet:namespace />holidayIds.value = <portlet:namespace />holidayIds.join(',');
10    }


This is the same functionality that are used in user portlet to remove Community,Roles etc..

Regards
Juhi