O controle deslizante é usado para fornecer dados de várias maneiras.
$render=explode(" ",$_POST["partial_render"]);
if($_POST["source"]=="nmb1"){
$valor=$_POST["nmb1_input"];
}
if($_POST["source"]=="spinner1"){
$valor=$_POST["spinner1_input"];
}
if($_POST["source"]=="barraTxt5"){
$valor=$_POST["txt5"];
}
$resposta="
<span id="alerta" class="ui-growl-pl" data-widget="widget_alerta" data-summary="data-summary" data-detail="data-detail" data-severity="all,error" data-redisplay="true"></span>
<script id="alerta_s" type="text/javascript">
DinarteCoelho.cw("Growl", "widget_alerta", {
id: "alerta",
sticky: false,
life: 6000,
escape: true,
keepAlive: false,
msgs: [{
summary: "Entrada alterada",
detail: "Valor: ".$valor."",
severity: "info",
severityText: "Information"
}]
});
</script>
";
dc.cw("Growl", "widget_alerta", {
id: "alerta"
, sticky: false
, life: 6000
, escape: true
, keepAlive: false
, msgs: []
});
dc.cw("InputText", "widget_txt", {
id: "txt"
});
dc.cw("Slider", "widget_basico", {
id: "basico"
, value: "50"
, input: "txt"
, min: 0.0
, max: 100.0
, animate: true
, step: 1.0
, orientation: "horizontal"
, range: false
});
dc.cw("InputText", "widget_sliderTxtMin", {
id: "sliderTxtMin"
});
dc.cw("Slider", "widget_minBasico", {
id: "minBasico"
, value: "50"
, input: "sliderTxtMin"
, min: 0.0
, max: 100.0
, animate: true
, step: 1.0
, orientation: "horizontal"
, range: "min"
});
dc.cw("InputText", "widget_sliderTxtMax", {
id: "sliderTxtMax"
});
dc.cw("Slider", "widget_maxBasico", {
id: "maxBasico"
, value: "50"
, input: "sliderTxtMax"
, min: 0.0
, max: 100.0
, animate: true
, step: 1.0
, orientation: "horizontal"
, range: "max"
});
dc.cw("InputText", "widget_decimal", {
id: "decimal"
});
dc.cw("Slider", "widget_barraDecimal", {
id: "barraDecimal"
, value: "0.2"
, input: "decimal"
, min: 0.2
, max: 7.1
, animate: true
, step: 0.1
, orientation: "horizontal"
, range: "max"
});
dc.cw("InputNumber", "widget_nmb1", {
id: "nmb1"
, disabled: false
, valueToRender: "0"
, min: 0.2
, max: 7.1
, currencySymbol: "R$ "
//, decimalPlaces: "0"
, leadingZero: "allow"
, selectOnFocus: false
, showWarnings: false
});
dc.cw("Slider", "widget_barraNmb1", {
id: "barraNmb1"
, value: "0"
, input: "nmb1_input"
, min: 0.0
, max: 100.0
, animate: true
, step: 1.0
, orientation: "horizontal"
, range: "min"
});
dc.cw("Spinner", "widget_spinner1", {
id: "spinner1"
, step: 50.0
, min: 0.0
, max: 1000.0
, suffix: " €"
, decimalPlaces: "0"
, thousandSeparator: ","
, decimalSeparator: "."
});
dc.cw("Slider", "widget_barraSpinner1", {
id: "barraSpinner1"
, value: "0"
, input: "spinner1_input"
, min: 0.0
, max: 1000.0
, animate: true
, step: 50.0
, orientation: "horizontal"
, range: "min"
});
dc.cw("Slider", "widget_barraTxt2", {
id: "barraTxt2"
, value: "0"
, input: "txt2"
, min: 0.0
, max: 100.0
, animate: true
, step: 1.0
, orientation: "horizontal"
, displayTemplate: "Definir proporção para %{value}"
, range: "min"
, display: "output"
});
dc.cw("InputText", "widget_txt3", {
id: "txt3"
});
dc.cw("Slider", "widget_barraTxt3", {
id: "barraTxt3"
, value: "0"
, input: "txt3"
, min: 0.0
, max: 70.0
, animate: true
, step: 10.0
, orientation: "horizontal"
, range: "min"
});
dc.cw("InputText", "widget_txt4", {
id: "txt4"
});
dc.cw("Slider", "widget_barraTxt4", {
id: "barraTxt4"
, value: "0"
, input: "txt4"
, min: 0.0
, max: 100.0
, animate: true
, step: 1.0
, orientation: "vertical"
, range: "min"
});
dc.cw("InputText", "widget_txt5", {
id: "txt5"
});
dc.cw("Slider", "widget_barraTxt5", {
id: "barraTxt5"
, value: "0"
, input: "txt5"
, min: 0.0
, max: 100.0
, animate: true
, step: 1.0
, orientation: "horizontal"
, range: "min"
, behaviors: {
slideEnd: function (ext, event) {
dc.ab({
s: "barraTxt5"
, e: "slideEnd"
, f: "formulario"
, p: "barraTxt5"
, u: "alerta"
}, ext);
}
}
});
dc.cw("Slider", "widget_barraTxt6Txt7", {
id: "barraTxt6Txt7"
, input: "txt6,txt7"
, values: [30, 80]
, min: 0.0
, max: 100.0
, animate: true
, step: 1.0
, orientation: "horizontal"
, displayTemplate: "Entre {min} e {max}"
, range: true
, display: "displayRange"
});