Is there a way to unset the value of a slider in jQuery Mobile 1.4.5? - jquery-mobile

I am using the following markup to display a slider with its value shown on its button:
<input type="range" name="my-slider" id="my-slider" min="1" max="5" step="0.5" value="" data-show-value="true" class="ui-hidden-accessible" />
When the slider is first displayed, there is no value attached to the slider. Only until I move the button or programmatically set the value, does the slider change. For example,
$('#my-slider').val(someNumber).slider('refresh');
Is there a way to programmatically reset the value back to its original state (with no value) ? If I set it to null or '', the value becomes 1 (min). If I set it to 6, the value becomes 5 (max). But how do I unset it?

Try this:
$('#my-slider').slider('destroy').val('').slider();
Since there is no method to reset to an empty value you destroy the slider instance, set the value, then recreate the slider.
If you initially passed some config values into slider() then add that as well.

Related

How to handle slider with hidden check box

I want to handle slider with hidden check box for scripts using watir.
Can any one help me to resolve this issue?
This would be more like visibility: hidden
Try setting the checkbox's opacity to 0. If you want the checkbox to be out of flow try position:absolute and offset the checkbox by a large number.
HTML
<label class="checkbox"><input type="checkbox" value="valueofcheckbox" checked="checked" style="opacity:0; position:absolute; left:9999px;">Option Text</label>
How many checkboxes do you have at this page? If there is only one then this might work:
browser.checkbox(attribute: attribute-value).when_present.set

Roblox TextBox display value is not the same as the value in the editor

I have a TextBox in a ScreenGui inside StarterGui. I've created a script that sets a variable named cash to 10. It should then procede to change the value of TextBox to 10; it does. Then, 1 second later, it increases cash by 10, and changes the value of TextBox to 20, but didn't display it. I then looked in the editor, and sure enough, it said 20 as the value.
Why was it displaying the original value, and not the actual value?
I believe you've selected the wrong TextBox. It is selected in your properties menu, but it is not highlighted on the screen. Maybe you're looking at the TextBox in the StarterGui? So that could be the problem with your script.

PrimeFaces slider - colored selected region

I'm trying to make colored selection region when using PrimeFaces slider component. So what i'm trying to do is, when user set slider value to something, selected value is colored from 0 to chosen value (look at image).
I know that PF are using jQuery ui and we can make this happen in jQuery like $("#slider").slider({range: "min"}); and then define background color like .ui-slider-range{background: green;}.
How can i manage this whith PF component slider? is this even possible? and what's the best way to accomplish this?
Thanks.
Without using javascript you can try to set the slider range attribute to true to display the two handles and than hide the first one via css.
You can try:
<p:slider range="true" for="zeroValue,sliderValue" styleClass="your-style-class"/>
<h:inputHidden id="zeroValue" value="0"/>
<h:inputHidden id="sliderValue"/>
css
.your-style-class span:nth-of-type(1) {
display: none;
}

Radio button not checked by default in jqxTreeGrid

I am trying to implement rowDetails functionality of jqxTreeGrid, my rowDetailsRenderer function returns something like :
return '<input type="radio" name="group1" checked="checked">';
Its not showing as checked. Event after the grid is loaded, I am not able to 'check' it through firebug as well. But its getting checked once I click it. Same behavior across firefox/IE/Chrome.
You have to put your checkbox inside a table
View this example: JqxTreeGrid rowdetail with checkbox

ZK BindComposer value set programmatically not applied while retrieving

I am using zk BindComposer for form binding. I have a combobox to which I set value programmatically . When I retrieve the value it's null. How to refreshing programmatically set value while using bindcomposer?
<div apply="org.zkoss.bind.BindComposer"
viewModel="#id('vm') #init('in_raster_hms.formCtrl.patient.PatientViewModel')"form="#id('patient') #load(vm.patient) ">
<combobox id="comboCity" selectedItem="#bind(patient.city)" ></combobox>
Controller:
comboCity.setSelectedIndex(2);
I set selected item programmatically. When I retrieve patient object from binder the value of comboCity is null. I think the combobox selection to be reload.
If I choose from combo manually it works fine.

Resources