You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

In this article, we will use the "URL Request Parameters for Datalist" option of List Grid or Popup Select Box form element to refine the result of popup datalist selection.

ในบทความนี้เราจะใช้ตัวเลือก "พารามิเตอร์คำขอ URL สำหรับดาต้าลิสต์" ของ List Grid หรือ Popup Select Box เพื่อปรับแต่งผลลัพธ์ของการเลือกดาต้าลิสต์ป๊อปอัพ

First, we will have to create a datalist and set the filter using Request Param Hash Variable. In this sample, our request parameter name is "group" and we are using Advanced Form Data Binder to retrieve form data. You are allow to use other binder and write your filter condition using Request Param Hash Variable.

ก่อนอื่นเราจะต้องสร้างดาต้าลิสต์และตั้งค่าตัวกรองโดยใช้ Request Param Hash Variable ในตัวอย่างนี้ชื่อพารามิเตอร์คำขอของเราคือ "กลุ่ม" และเรากำลังใช้ Binder ข้อมูลของฟอร์มขั้นสูงเพื่อดึงข้อมูลในแบบฟอร์ม คุณได้รับอนุญาตให้ใช้สารยึดเกาะอื่นและเขียนเงื่อนไขตัวกรองของคุณโดยใช้ตัวแปรขอแฮชตัวแปร


After we have our datalist ready, let make a form as following. In this form, we will have a Popup Select Box and a List Grid which will use the datalist we just created as popup selection dialog. We will have a select box which will be used to filter the datalist result and its field id is set to "filter".

หลังจากที่เราเตรียมดาต้าลิสต์ของเราเสร็จแล้วให้ทำแบบฟอร์มต่อไปนี้ ในแบบฟอร์มนี้เราจะมี Popup Select Box และ List Grid ซึ่งจะใช้ดาต้าลิสต์ที่เราเพิ่งสร้างเป็นกล่องโต้ตอบการเลือกป๊อปอัพ เราจะมีกล่องที่เลือกซึ่งจะใช้ในการกรองผลลัพธ์ดาต้าลิสต์และฟิลด์ ID ของมันถูกตั้งค่าเป็น "ตัวกรอง"


Configure the "URL Request Parameters for Datalist" option of Popup Select Box and List Grid as following.

กำหนดค่าตัวเลือก "พารามิเตอร์คำขอ URL สำหรับ Datalist" ของ Popup Select Box และ List Grid ดังต่อไปนี้


By configure this way, the element will retrieve the configured field value and pass it as a url request parameters to the datalist when the popup select dialog is open. In this care, the value of "filter" field will pass as the value of "group" parameter. You can configure a default value if you want to. The default value will be used when configured field return empty value.

Let us populate some data to our datalist for testing.

ด้วยการกำหนดค่าด้วยวิธีนี้องค์ประกอบจะดึงค่าฟิลด์ที่กำหนดค่าและส่งผ่านเป็นพารามิเตอร์คำขอ URL ไปยังนักข้อมูลเมื่อเปิดกล่องโต้ตอบเลือกป๊อปอัป ในส่วนนี้ค่าของฟิลด์ "ตัวกรอง" จะผ่านเป็นค่าของพารามิเตอร์ "กลุ่ม" คุณสามารถกำหนดค่าเริ่มต้นได้หากต้องการ จะใช้ค่าเริ่มต้นเมื่อฟิลด์ที่กำหนดค่าส่งคืนค่าว่าง

ให้เราเติมข้อมูลบางส่วนไปยังนักทดสอบข้อมูลของเราเพื่อทำการทดสอบ


Now, in our form, when the select box value is "Group2", the available result in our popup selection dialog will only shown the data which have group equal to "group2".

ตอนนี้ในรูปแบบของเราเมื่อค่ากล่องที่เลือกคือ "Group2" ผลลัพธ์ที่มีอยู่ในกล่องโต้ตอบการเลือกป๊อปอัพของเราจะแสดงเฉพาะข้อมูลที่มีกลุ่มเท่ากับ "group2"



The sample app for this article: 

แอปตัวอย่างสำหรับบทความนี้:


APP_form_how_to_url_params-1-20151119114709.jwa

Related Elements

องค์ประกอบที่เกี่ยวข้อง




  • No labels