Default Set Empty value for jqxDataTime Input - jqxwidgets

We need help for Date Time Input to set by default blank. We are using the code below for that, but we can’t set it blank.
$("#start_date1").jqxDateTimeInput({width: 150, height: 22, formatString:'dd-MMM-yy', theme: theme,clearString: 'Clear'});
Could you please help us?
Thanks

To achieve this, just set the value property to null, e.g.:
$("#jqxWidget").jqxDateTimeInput({ width: '250px', height: '25px', value: null });
The clearString property refers to the “Clear” button in the dropdown calendar.

Related

how to make text vertically center in fabric js TextBox

I am working on one fabric js editor, in which I need to implement TextBox as a Button look and feel,
For that, I Have implemented TextBox with Background, But Problem is that Height of TextBox.
I am trying this kind of code :
var text = new fabric.Textbox("this is text", {
top: 0,
left: 0,
width: 300,
height: 500,
fill: 'red'
})
canvas.add(text);
Now my Textbox is rendered of width: 300 but height is not rendered. how can I set Height to My TextBox
And another Thing, when I set Height to TextBox, I need to keep text in Center of height (vertical center)
what should I do, I can't understand, how to override default fabtic.Textbox class.
Please help me, If any one have Any suggestion.

Select2: how to make list not wrap in dropdown and multiple selection

Since the my Select2 dropdown list default behavior would adjust width according to selection and mess up my frame, I'd like it not to wrap the text.
I've tried several combinations with no result (see below)
var $select1 = $('<select/>', {
//'class': "form-control",
'class': displaySearchClass,
'id': cbxID1,
//'width': largeurMenu,
'multiple': 'multiple',
//'white-space': 'normal!important',
//'dropdownAutoWidth' : 'true',
//'overflow': 'hidden',
//'text-overflow': 'ellipsis',
//'white-space': 'nowrap !important',
});
below is a screenshot of my problem and another of what I want it to be looking like
Default behavior
What I want to achieve
try this:
$("#myselect").select2({ width: '100%' });
From

Set position for each flag in highstock

I'm trying to change the position of each flag in a chart and I'm using highstock.
I add each flag like this:
{
x: time,
shape: 'url(images/indicators/down_fractal.png)',
y:value,
title: ' ',
text: 'Fractal: ' + value
};
And there is my serie config:
seriesConf : {
id: this.uniqueID,
name: this.toString(),
data: this.indicatorData,
type: 'flags',
onSeries: this.options.onSeriesID, //Series ID on which this flags will be rendered
height: 10,
width: 10,
//y: 100,
//turboThreshold: 0
}
The y value is suppose to set the position of flag but its not working?is it even possible to define each flag position?
In this sample you change the y value and nothing happens.
The main i idea is to create a chart like this:
Flag series is rendered directly above the series, there is no y option for point (see API).
I think you want to use simple scatter series with markers, take a look: http://jsfiddle.net/ujgLzkq9/1/
Or use two flag series (one above, and second one below the line), using series.y option.

JqueryUi Spinner Custom steps

I am looking to make the jqueryUI spinner increment by a set of custom values on a list.
For example, 25, 50, 100, 250, 500, 1000
Is this possible?
The closest thing I can get it doing is stepping by a set amount.
Maybe it can be done by manually changing the value on the .spin call?
Any help on this would be great thanks
you can use this code,
var dlist = ['100','250','500', '1000']
$( ".spinner" ).spinner({
min: 0,
max: 3,
create: function(){
$(this).parent().append('<input class="spinner-text" value="'+dlist[$(this).val()]+'">');
},
stop: function(event,ui) {
$(this).siblings('.spinner-text').val(dlist[$(this).val()]);
}
});
Source
Note: if your array contains 4 values, set max as 3. because first value is already set by default.
see the DEMO

add textfield on clicking a button in sproutcore

How to add more textfields in a view on clicking a button in the same view in sproutcore?
I have a sliding pane with particular number of textfields. On clicking a button, I need to add more number of text field in the same view.
Or,
I should be able to select the number from a select button view and show those many number of textfield in the same view.
I would recommend using a SC.ListView for this purpose.
You should have a SC.ArrayController whose content is an array containing objects that represent each text field. This may be as simple as something like this:
MyApp.myController = SC.ArrayController.create({
content: [
SC.Object.create({ someProperty: "Text field value 1" }),
SC.Object.create({ someProperty: "Text field value 2" }),
SC.Object.create({ someProperty: "Text field value 3" })
]
});
Next, you'll create your SC.ListView and bind it's content to the controller, and create the exampleView whose content is bound to the someProperty property of the objects:
MyApp.MyView = SC.View.extend({
childViews: 'scrollView addButtonView'.w(),
scrollView: SC.ScrollView.extend({
layout: { top: 0, left: 0, right: 0, bottom: 50 },
contentView: SC.ListView.extend({
contentBinding: 'MyApp.myController.arrangedObjects',
rowHeight: 40,
exampleView: SC.View.extend({
childViews: 'textFieldView'.w(),
textFieldView: SC.TextFieldView.extend({
// Add a little margin so it looks nice
layout: { left: 5, top: 5, right: 5, bottom: 5 },
valueBinding: 'parentView.content.someProperty'
})
})
})
}),
addButtonView: SC.ButtonView.extend({
layout: { centerX: 0, bottom: 10, width: 125, height: 24 },
title: "Add Text Field",
// NOTE: The following really should be handled by a statechart
// action; I have done it inline for simplicity.
action: function() {
MyApp.myController.pushObject(SC.Object.create({ value: "New Field" }));
}
})
});
Now, when you click the "Add Text Field" button, it will add a new object to the controller array which will automatically re-render the list view with the new object and hence, the new text field.
A couple of notes:
This uses a SC.ScrollView in conjunction with the SC.ListView, you will almost always want to do it this way.
Since we are using standard bindings (not SC.Binding.oneWay()), editing the text fields will automatically update the someProperty property in the objects in MyApp.myController and vice versa: if you update the value via some other means, the text field should automatically update as well.
This should not be used for a large list as using the childViews method of view layout can be slow. If you need performance, you should change the exampleView to a view that overrides the render() method and manually renders a text input and sets up the proper change events and bindings.
Lastly, I can't remember if the proper syntax for the text field's valueBinding is parentView.content.someProperty or .parentView.content.someProperty (notice the period at the beginning). If the first way doesn't work, try adding the . and see if that works.
Like Topher I'm assuming you're using SproutCore not Ember (formerly SC2).
If you need to add an arbitrary child view to an arbitrary location on your view, you want view.appendChild. In the button's action, you would do something like this:
this.get('parentView').appendChild(SC.View.create({ ... }))
If you go this route, you'll have to figure out the layout for the new view yourself. If you don't need to precisely control the layout, then go with Topher's solution - the ListView does the layout piece for you.

Resources