Select field using Ajax to reload select field

This example covers the development of a search application using the Ajax field reload.

Creating a new grid

1. Create a new grid application using the SQL Select Statement as below:

SELECT
E.EmployeeID, E.LastName, E.FirstName, E.Title, E.TitleOfCourtesy, E.BirthDate, E.HireDate, 
E.Address, E.PostalCode, E.Country, E.CityID, E.RegionID, E.HomePhone, E.Extension, E.Photo, 
E.Notes, E.ReportsTo, E.PhotoPath, U.EmployeeID, U.TerritoryID
FROM
employees E INNER JOIN employeeterritories U ON E.EmployeeID = U.EmployeeID
INNER JOIN territories T ON U.TerritoryID = T.TerritoryID

2. Select the Fields Positioning option in the application menu and choose U.EmployeeID, E.LastName, E.FirstName, E.Title, E.BirthDate, E.HireDate, E.RegionID, U.TerritoryID and E.Country fields.

3. Open Grid folder and click in Grid Modules.

4. Set the Search as the initial module.

Choosing Search fields

5. Open the Search folder and click in Advanced Search >> Select Fields.

6. Choose E.RegionID and U.TerritoryID fields.

Search Fields Settings

7. Open U.TerritoryID field, in search fields.

8. Change Data Type attribute to Select.

9. Open the Search Lookup block and configure the settings according to the image below.

SQL

SELECT territoryid, territorydescription 
FROM territories 
WHERE regionid = {e.regionid} AND
territoryid IN (SELECT DISTINCT territoryid FROM employeeterritories)
ORDER BY territoryid

10. Open E.RegionID settings, modify the Data Type attribute to Select configure it as following .

SQL

SELECT regionid, regiondescription 
FROM region 
WHERE regionid IN (SELECT DISTINCT regionid FROM employees)
ORDER BY regionid

Enabling Ajax to reload the field

11. Open the Ajax Processing block and mark the option “Use AJAX to reload…”.

12. Click “Run application”

Tutorials in the same category

Subquery XML export

1- Create an application of Grid 2- Go to the toolbar option on the side menu to enable ...

Send summary exported by email

In this tutorial we will be looking at how to export the summary and send it by email. Creat...

Send grid exported by email

1- Create an application of the type grid 2- Proceed to go in the side menu Export /...

Advanced Filter Tags (Chart)

In this tutorial we will see how an advanced filter can be applied within a Chart application ...

Comment this post