FLEX:通过将调用者对象 ID 传递给函数来动态访问多个数据网格
已解决
我正在开发一个 Flex/PHP 应用程序。
我有一个数据源 ArrayCollection,但有 8 个数据网格(名为 dg1 到 dg8)。我使用 8 个数据网格进行逻辑演示(大学 4 年,每年 2 个学期)。我有一个带有“X”(表示“删除此记录”)的列,单击该列后将转到一个函数。
我想做的是将数据网格 ID(例如“dg1”)和数据提供者 {syllabus.freshFall} 传递给函数。我一直在尽最大努力寻找如何做到这一点,但只找到了单个数据网格的示例(看起来很简单)并引用了这样的单个固定数据网格:
course_id=dg1.selectedItem.course_ID;
syllabus.freshFall.removeItemAt(dg1.selectedIndex);
我想让它像这样:
course_id=**whateverDataGrid**.selectedItem.course_ID;
**whateverDataProvider**.removeItemAt(**whateverDataGrid**.selectedIndex);
现在我需要帮助将我的 c_id 变量传递给我的 HTTPService。
感谢您的帮助!
SOLVED
I have a Flex/PHP app I'm working on.
I have a single ArrayCollection for a data source, but have 8 datagrids (named dg1 through dg8). I use 8 datagrids for logical presentation (4 years of college, 2 semesters per year). I have a column with "X" (for "delete this record") that goes to a function when clicked.
What I'd like to do is pass the datagrid id (such as "dg1") and the data provider {syllabus.freshFall} to a function. I've been trying my hardest to find how I do this, but have only found examples of single datagrids (which look pretty easy) and referring to a single fixed datagrid like this:
course_id=dg1.selectedItem.course_ID;
syllabus.freshFall.removeItemAt(dg1.selectedIndex);
I want to make this something like this:
course_id=**whateverDataGrid**.selectedItem.course_ID;
**whateverDataProvider**.removeItemAt(**whateverDataGrid**.selectedIndex);
NOW I need help passing my c_id variable to my HTTPService.
Thanks for ALL your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
部分答案:
在的帮助下Adobe LiveDocs for Flex 3
我仍然想让数据提供者更像一个变量,只是为了完整。我尝试了几种不同的方法,案例陈述最接近我想要的,并且目前有效。
弄清楚将我的 c_id 变量从我的函数传递到我的 HTTPService。并不完全像我希望的那么直接......
构建一个对象类型的变量
将一个元素添加到要传递的变量名称的对象中
为变量添加一个值。
通过
它看起来像这样:
希望这对其他人有帮助。将这一切拼凑在一起有点痛苦。
PARTIAL ANSWER:
with help from Adobe LiveDocs for Flex 3
I would still like to make the data provider more of a variable, just to be complete. I tried several different approaches and the case statements were the closest to what I wanted and it worked for now.
Figured out passing my c_id variable from my function to my HTTPService. Not exactly as straight-forward as I would have hoped...
Build a variable in the type of Object
Add an element to the object of the name of your variable you want to pass
Add a value for the variable.
Pass the
It looks like this:
Hope this helps someone else. It's been a bit of a pain to piece this all together.