gpt4 book ai didi

dynamic - Qcube/Qcodo 动态输入字段

转载 作者:行者123 更新时间:2023-12-01 05:25:27 25 4
gpt4 key购买 nike

有没有人举个例子,如何在我的 qcubed 项目中添加动态输入字段?
谢谢!

最佳答案

您可以利用 QPanel 控件动态添加控件。只需将其 AutoRenderChildren 属性设置为 true 并将动态控件父项设置为 QPanel。

// Instantiate our QPanel - this will render a div to contain our dynamic controls
// Note that the parent is $this. You will need to call render in your template
$this->pnl = new QPanel($this);
// Setting AutoRenderChildren so that the Panel will handle Rendering our dynamic
// controls.
$this->pnl->AutoRenderChildren = true;
// Creating a button with an Ajax action to create our dynamic controls
$this->btn = new QButton($this);
$this->btn->Text = "Add Control";
$this->btn->AddAction(new QClickEvent(), new QAjaxAction('btn_Click'));

protected function btn_Click($strFormId, $strControlId, $strParameter) {
// create the control and set its parent to the QPanel
$ctl = new QTextBox($this->pnl);
}

您可以在 QCubed 示例网站上获得有关使用 QPanels 的更多信息。

QCubed QPanel Example

关于dynamic - Qcube/Qcodo 动态输入字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14113474/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com