Created a query to get distinct item for the user.
Also the result is passed to the view.
Added to ajax view the function call to function to edit items.