We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Filtering template image columns

Thread ID:

Created:

Updated:

Platform:

Replies:

126399 Oct 13,2016 10:44 AM UTC Oct 17,2016 05:40 AM UTC JavaScript 3
loading
Tags: ejGrid
Carlos Rodríguez García
Asked On October 13, 2016 10:44 AM UTC

Hi,

I have a column where a template like this is applied:

            <script type="text/x-jsrender" id="statusTemplatePLP">
                <img src="/Content/Images/status/{{*: data.status}}.png" alt="{{*: data.status}}" title="{{*: data.status}}" />
            </script>

That status can be something like "In Review".

I am using the filtering bar to filter records and on this field, I cannot use it as it does not filter. If I try to type "In" it yields no results as the image is there instead of the text. I have also tried adding a <a>In review</a> in front of the image and still it does not work.

Is there a way to apply a custom filter for a specific field?

Thank you for your support!

Kind regards,
Carlos

Ragavee U S [Syncfusion]
Replied On October 14, 2016 08:49 AM UTC

Hi Carlos, 

Generally, the filtering action is performed based on the field property of the column. However if you want to apply custom filter on a column, then we suggest you to use the filterBarTemplate feature of the grid. Please refer to the below online sample link for more information on this feature. 


Please refer to the below demo link in which we have achieved your requirement to apply custom filter for a column. 


In the above sample, we have bound “Title” field for the template column and have displayed images based on the “EmployeeID” column. Using the filterBarTemplate feature, we have created an input element using create event And have bound the read function in the focusout event of the input element. 

As you can see, in the read function, we have invoked the filterColumn method of the grid passing the field, value and operator for performing filtering operation on that specific field. 

Regards, 
Ragavee U S. 


Carlos Rodríguez García
Replied On October 14, 2016 10:25 AM UTC

Hi,

Thank you very much for the information, this has solved my issue and given me some great ideas!

Again, thank you for your support!

Kind regards,
Carlos

Ragavee U S [Syncfusion]
Replied On October 17, 2016 05:40 AM UTC

Hi Carlos, 
  
Thanks for your update. 
 
We are happy that your requirement is achieved. 
  
Regards, 
Ragavee U S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;