היי,
אני משתמש בדרופל 7
בניתי מודול שיוצר טופס אשר מפורמט כטבלה.
יש בכל שורה בטבלה כפתור "ADD" אשר אמור לפתוח MODAL POPUP FORM בעל מספר משתנה של שדות קלט (לפי השורה שנלחצה בטבלה)
לאחר שהמשתמש ממלא את השדות ב-POPUP, הוא אמור ללחוץ על SUBMIT שיעביר את הערכים לFORM המקורי ויוסיף אותם לטבלה (ע"י AJAX ללא REFRESH לעמוד)
אני קצת תקוע באיך לממש את הדרישה הנ"ל:
1. איך ליצור POPUP ולהעביר אליו ערכים כך שמספר וסוג השדות יהיה דינמי? (חשבתי לבנות HIDDEN DIV ולהשתמש ב JQUERY UI DIALOG)
2. איך אני מחזיר ערכים מה-POPUP לAJAX CALLBACK של דרופל שאוכל לעדכן את ה FORM
לא מצאתי דוגמא פשוטה של שימוש ב POPUP DIALOG כקלט
תודה על כל עזרה/רעיון/כיוון
English version from http://drupal.org/node/1150264
Hi,
I'm using D7.
I have a module that creates a form, the form has an 'Add' button.
I want that a click on the button will open a modal dialog box (I was thinking jQuesry UI dialog) with few textfields for the user the enter data and click the submit on the dialog. This will close the dialog and add the data from the dialog to the form (via ajax call if possible) - so the form will have new entries.
I'm kind of lost in how to begin:
* how to create the dialog form? (do I create the dialog in JS or in php/drupal form api?)
* how to pass data to the dialog, and how to get data back from it?
I can't find any simple code sample, the ones I have found are too complex for me to understand.
please point me in the right direction.
Thank you.