【发布时间】:2014-05-27 09:32:15
【问题描述】:
我有一个
- 打开模式窗口的按钮,以及
- jquery dynatree。
如何将 js 中的变量(树中选定节点的 id)传递给 Yii 中的 modal?
//the modal window
$this->widget('bootstrap.widgets.TbModal', array(
'id' => 'createExercise',
'header' => 'Create..',
'content' => $this->renderPartial('_form', ['model'=>$model], 1),
'footer' => [
TbHtml::button('Save', ['onclick'=>'$("#exercise-form").submit()']),
],
));
//the button
TbHtml::button('Create', array(
'id' => '#btnCreate',
'data-toggle' => 'modal',
'data-target' => '#createExercise',
));
我使用以下代码从树中获取活动节点的 ID:
$("#yw0").dynatree("getActiveNode").data.id;
如何将此 ID 传递给模态框? 谢谢!
【问题讨论】:
标签: javascript php jquery yii