HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
574_noform.php
Go to the documentation of this file.
1 <?php // Issue #574: multiselect without form should send all selected elements
2 $this->widget(
3  'bootstrap.widgets.TbSelect2',
4  array(
5  'name' => 'group_id_list',
6  'data' => array('RU' => 'Russian Federation', 'CA' => 'Canada', 'US' => 'United States of America', 'GB' => 'Great Britain'),
7  'htmlOptions' => array(
8  'multiple' => 'multiple',
9  'id' => 'issue-574-checker-select'
10  ),
11  )
12 );
13 echo CHtml::endForm();
14 $this->widget(
15  'bootstrap.widgets.TbButton',
16  array(
17  'label' => 'Click on me with Developer Tools opened!',
18  'htmlOptions' => array(
19  'onclick' => 'js:$.ajax({
20  url: "/",
21  type: "POST",
22  data: (function () {
23  var select = $("#issue-574-checker-select");
24  var result = {};
25  result[select.attr("name")] = select.val();
26  return result;
27  })() // have to use self-evaluating function here
28  });'
29  )
30  )
31 );