cgridview ボタンから yiistap モーダルにデータを渡したいです。Bootstrapモーダルに値を渡す方法に関するstackoverflowに関する以前の質問を確認しました。yiistrap についても同様に試しましたが、うまくいきません。
//cgridview buttons code which opens dashboard created using yiistrap modal.
'buttons'=>array (
'Open Dashboard' => array (
'options' => array(
'data-toggle'=>'modal',
'data-target' => '#myModal',
'data-id' => '$data->siteID',
'csrf' => true,
),
'icon' => 'briefcase',
),
),
//code in modal-body
<input type="text" name="bookId" id="bookId" value=""/>
<script>
$(document).ready(function(){
var $this = $(this);
var myBookId = $this.data(\'id\');
$("#bookId").val(myBookId);
}
);
</script>
ここでの問題は、myBookId が常に null であることです。だから、誰が私がどこで間違いを犯しているのか教えてもらえますか? ここに私が作成したフィドルhttp://jsfiddle.net/ujhGX/があります。データ ID を表示する必要があります。