It is possible to implement grid js2 with php code on the server side

It is possible to implement grid js2 with php code on the server side. I have done it successfully with js1.
Do you have an example code to start with?

Thank you very much and greetings

7 Replies

JR John Rajaram Syncfusion Team August 30, 2018 09:58 AM UTC

Hi Gustavo, 
Thank you for contacting Syncfusion support. 
Currently there is no support for EJ 2 Grid with PHP platform. Hence we have logged a feature report regarding this. It will be implemented in any of our upcoming main release. We will update you once this feature has got implemented. 
Please let us know if you have any concern. 
Regards, 
John R 



GU Gustavo replied to John Rajaram May 27, 2019 07:37 PM UTC

Hi Gustavo, 
Thank you for contacting Syncfusion support. 
Currently there is no support for EJ 2 Grid with PHP platform. Hence we have logged a feature report regarding this. It will be implemented in any of our upcoming main release. We will update you once this feature has got implemented. 
Please let us know if you have any concern. 
Regards, 
John R 


It is possible to implement grid js2 with php code on the server side. I have done it successfully with js1.
Do you have an example code to start with?

Thank you very much and greetings


JA Jesus Arockia Sankaran S Syncfusion Team May 28, 2019 08:13 PM UTC

Hi Gustavo, 

We have created the KB for PHP with EJ2 controls. Please find the link below. 

 
Regards, 
Jesus Arockia Sankaran S 
 



GU Gustavo April 18, 2020 06:58 PM UTC

I have implemented grid js2 with php code on the server side.

I have successfully paged and ordered

When I implement the filters it is sent to the server:  (startswith(tolower(descripcion),'tea')) and (tolower(producto_tipo) eq '19')"

I have many problems to translete this string (startswith(tolower(descripcion),'tea')) and (tolower(producto_tipo) eq '19')" to SQL (mysql) language.  It´s posible js2 grid sent to server side descripcion like 'tea%' and producto_tipo=19?

On the other hand, when grouping columns, I do not know that the parameters are sent to the server

Thanks a lot






MS Manivel Sellamuthu Syncfusion Team April 21, 2020 03:01 PM UTC

Hi Gustavo, 

Yes , From your query we can understand that you want to modify the query which is being sent to server. For this requirement you can use Custom Adaptor. 

Sometimes the built-in adaptors does not meet your requirement. In such cases you can create your own adaptor. Please refer the below documentation link for more information. You can override the default Query of the Adaptor using processQuery and processResponse methods. 

Also while overriding the processQuery method you can get the required parameters for all grid actions. 

 
Please let us know, if you need further assistance. 
 
Regards, 
Manivel 



GU Gustavo April 21, 2020 04:02 PM UTC

Do you have an example of how I can process the parameter "filter" on the server.  I think that if I can translate (startswith(tolower(descripcion),'tea')) and (tolower(producto_tipo) eq '19')" to SQL (mysql) language. ( descripcion like 'tea%' and producto_tipo=19?) The default 0functionality of j2 grids would work perfectly for me.   We are working with PHP on the server

Thank you very much in advance


MS Manivel Sellamuthu Syncfusion Team April 22, 2020 10:58 AM UTC

Hi Gustavo, 
 
Thanks for your update. 
 
From your query, we suspect that you want to handle EJ2-Grid actions in back-end (PHP framework). But unfortunately, our EJ2-DataManager does not have support in PHP framework. Also, we would like to inform that we will generate and pass the queryString (based on the Grid actions) from the Grid. So you can override the default query based on your server by using ‘processQuery’ of CustomAdaptor in the DataManager. So you need to handle all the Grid actions by yourself based on this queryString in your backend. Please refer the below kb to know more details about how to use EJ2-controls in PHP, 

 
Please find the cod example for override the default query based on your server by using ‘processQuery’ 



export class CustomAdaptor extends ODataAdaptor { 
     processQuery(dataManager, query) { 
       // you can form the query based on your service 
       var query = super.processQuery(dataManager, query); 
// get the default query and then customize the query based on your requirement and return the result 
       return query; 
    }  
} 
export class RemoteDataBinding extends SampleBase { 
    constructor() { 
        super(...arguments); 
       
        this.hostUrl = 'https://js.syncfusion.com/demos/ejServices/Wcf/Northwind.svc/Orders/'; 
        this.data = new DataManager({ url: this.hostUrl, adaptor: new CustomAdaptor }); 
    } 



Please let us know, if you need further assistance. 

Regards, 
Manivel 


Loader.
Up arrow icon