summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable
diff options
context:
space:
mode:
authorJens Klaer <kj.landwehr.software@gmail.com>2015-05-20 15:56:09 +0200
committerJens Klaer <kj.landwehr.software@gmail.com>2015-05-20 15:56:09 +0200
commit55338f1cf947b8593a3e23094d6feab625370e28 (patch)
treee8d714ed8afad949c9e3ee93cf1fcc0602d92b36 /demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable
parent0fb75d64f8dbcc98b4c06e7556125b94bf612819 (diff)
extended quichstart tutorial for TJuiControl option changes during callback
Diffstat (limited to 'demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable')
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.page23
-rw-r--r--demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.php21
2 files changed, 39 insertions, 5 deletions
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.page b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.page
index cbb1465b..e653308c 100644
--- a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.page
+++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.page
@@ -17,17 +17,36 @@
background: lime;
border: 1px solid black;
}
+
+ .ui-sortable li.ui-sortable-highlight {
+ background: red;
+ border: 1px solid black;
+ height: 17px;
+ }
</com:TStyleSheet>
<table class="sampletable">
<tr><td class="samplenote">
-Default options with a little css applied:
+Default options with a little css applied, change options during callback:
</td><td class="sampleaction">
<com:TJuiSortable
ID="repeater1"
onStop="repeater1_onStop"
/>
- <com:TActiveLabel ID="label1" />
+ Items order: <com:TActiveLabel ID="label1" />
+ <div><com:TActiveCheckBox OnCheckedChanged="sort1" Text="Apply CSS dragging placeholder" /></div>
+ <div><com:TActiveCheckBox OnCheckedChanged="sort2" Text="Revert to new position using a smooth animation" /></div>
+ <div>
+ Cursor is
+ <com:TActiveDropDownList OnSelectedIndexChanged="sort3">
+ <com:TListItem Text="auto" Value="auto" Selected="true" />
+ <com:TListItem Text="move" Value="move" />
+ <com:TListItem Text="pointer" Value="pointer" />
+ <com:TListItem Text="crosshair" Value="crosshair" />
+ <com:TListItem Text="help" Value="help" />
+ </com:TActiveDropDownList>
+ while dragging
+ </div>
</td></tr>
</table>
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.php b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.php
index d96df302..cca55f67 100644
--- a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.php
+++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiSortable/Home.php
@@ -18,14 +18,29 @@ class Home extends TPage
{
$this->repeater1->DataSource=$this->data;
$this->repeater1->dataBind();
+ $this->label1->Text = implode(' ', $this->data);
}
}
public function repeater1_onStop($sender, $param)
{
- $this->label1->Text="Items order:";
$order = $param->getCallbackParameter()->index;
- foreach($order as $index)
- $this->label1->Text.=' '.$this->data[$index];
+ foreach ($order as $key => $index) $order[$key] = $this->data[$index];
+ $this->label1->Text = implode(' ', $order);
+ }
+
+ public function sort1($sender, $param)
+ {
+ $this->repeater1->getOptions()->placeholder = $sender->getChecked() ? 'ui-sortable-highlight' : false;
+ }
+
+ public function sort2($sender, $param)
+ {
+ $this->repeater1->getOptions()->revert = $sender->getChecked();
+ }
+
+ protected function sort3($sender, $param)
+ {
+ $this->repeater1->getOptions()->cursor = $sender->getSelectedValue();
}
}