Extjs 4, arrange form fields in tbar - extjs4

tbar : new Ext.Toolbar({
items : [
'',{
xtype : 'radiofield',
name : 'searchType',
value : 'order_name',
boxLabel : 'Order Name'
},'',{
xtype : 'radiofield',
name : 'searchType',
value : 'order_no',
boxLabel : 'Order No'
},'',{
xtype : 'radiofield',
name : 'searchType',
value : 'status',
boxLabel : 'Status'
},'=',{
xtype : 'textfield',
name : 'keyword',
value : 'Keyword'
},'|',{
xtype : 'datefield',
name : 'order_from',
fieldLabel : 'From ',
labelStyle : 'width:50px',
value : new Date()
},'~',{
xtype : 'datefield',
name : 'order_to',
fieldLabel : "To ",
labelStyle : 'width:50px',
value : new Date()
},'|',{
xtype : 'button',
text : "Search"
}
]
})
I put my questions into attached image.
(Space between ratio buttons and remove strange right margin space in datefield.)
and the button in the tbar looks not like button. it looks just text. anybody know make it good looking button?
thank you!

To add space you can add inside the quotes, essentially any html can be inserted including images.
The extra space is related to the width the date field is trying to grab. You should not set width in the labelStyle but set it directly so that the field can properly calculate the amountof space that it needs.
For example:
labelWidth: 50, //label only
width: 200, //label + input
your live example: http://jsfiddle.net/dbrin/PhAbR/2/

Related

auto_complete feature not using filter_plugin_options when using yadcf

I am using the auto_complete feature in yadcf plugin. I want to set the minLength for it, but on setting it the option does not seem to reflect on the page.
Please have a look at my code
yadcf.init(table,
[{
column_number : 0,
filter_type : "auto_complete",
filter_container_id: "selName",
filter_default_label : "Type Name",
cumulative_filtering : true,
filter_reset_button_text : "",
reset_button_style_class : "searchicon glyphicon glyphicon-remove-circle",
filter_match_mode : "startsWith",
filter_plugin_options :{
minLength : 3
}
});
can you please let me know what I have missed and what changes I need to do?

dijit/form/FilteringSelect not working in phone

i have a drop down using dijit/form/FilteringSelect which is not supporting in mobile but it is working on web. i need my drop down to work in both web and mobile.can any one help
require(
[ "dojo/store/Memory", "dijit/form/FilteringSelect", "dojo/domReady!"],
function(Memory, FilteringSelect) {
var filteringSelect = new FilteringSelect({
id : "statusList",
value : "id",
style : "width: 150px;",
maxLength: "50",
placeHolder : "-- select one --",
displayedValue : defaultStatus,
onChange : setStatusId,
store : dataStore,
}, "statusList");
filteringSelect.startup();
});
You should have a look to dojox/mobile/SearchBox widget.
It'll do the same job than dijit/form/FilteringSelect with approximately the same configuration (You can pass to it the same datastore).

How to send keypress in nightwatch

I know how to send click events with nightwatch:
browser.click('#my-control');
But I have been unable to find a way to send key events. How is this done in nightwatch?
You can try the following way to press any key in nightwatch.js; I am pressing T and it is working superb!
client.keys("t", function(done) {
client.pause(5000);
client.expect.element('#carousel_container').to.have.css('display').which.equals('block');
});
We are using the above way because nightwatch.js Keys does not have any alphabet command in its array, I have consoled and I haven't found any alphabet to press it.
Keys:
{ NULL: '',
CANCEL: '',
HELP: '',
BACK_SPACE: '',
TAB: '',
CLEAR: '',
RETURN: '',
ENTER: '',
SHIFT: '',
CONTROL: '',
ALT: '',
PAUSE: '',
ESCAPE: '',
SPACE: '',
PAGEUP: '',
PAGEDOWN: '',
END: '',
HOME: '',
LEFT_ARROW: '',
UP_ARROW: '',
RIGHT_ARROW: '',
DOWN_ARROW: '',
ARROW_LEFT: '',
ARROW_UP: '',
ARROW_RIGHT: '',
ARROW_DOWN: '',
INSERT: '',
DELETE: '',
SEMICOLON: '',
EQUALS: '',
NUMPAD0: '',
NUMPAD1: '',
NUMPAD2: '',
NUMPAD3: '',
NUMPAD4: '',
NUMPAD5: '',
NUMPAD6: '',
NUMPAD7: '',
NUMPAD8: '',
NUMPAD9: '',
MULTIPLY: '',
ADD: '',
SEPARATOR: '',
SUBTRACT: '',
DECIMAL: '',
DIVIDE: '',
F1: '',
F2: '',
F3: '',
F4: '',
F5: '',
F6: '',
F7: '',
F8: '',
F9: '',
F10: '',
F11: '',
F12: '',
COMMAND: '',
META: ''
},
You can press any key in above array easily like "client.keys(client.Keys.ENTER);".
if you entend to send a simple key stroke, you can do it directly through the following
browser.keys('j')
this will simulate the pressing on the J key
but according to http://nightwatchjs.org/api#setValue
this should also do the job
demoTest = function (browser) {
browser.setValue('input[type=text]', ['this does the job', browser.Keys.ENTER]);
};
So if you need a press a simple character, send it as string, otherwise use one of the special character in the key.json in the nightwatch package
{
"NULL" : "\uE000",
"CANCEL" : "\uE001",
"HELP" : "\uE002",
"BACK_SPACE" : "\uE003",
"TAB" : "\uE004",
"CLEAR" : "\uE005",
"RETURN" : "\uE006",
"ENTER" : "\uE007",
"SHIFT" : "\uE008",
"CONTROL" : "\uE009",
"ALT" : "\uE00A",
"PAUSE" : "\uE00B",
"ESCAPE" : "\uE00C",
"SPACE" : "\uE00D",
"PAGEUP" : "\uE00E",
"PAGEDOWN" : "\uE00F",
"END" : "\uE010",
"HOME" : "\uE011",
"LEFT_ARROW" : "\uE012",
"UP_ARROW" : "\uE013",
"RIGHT_ARROW" : "\uE014",
"DOWN_ARROW" : "\uE015",
"ARROW_LEFT" : "\uE012",
"ARROW_UP" : "\uE013",
"ARROW_RIGHT" : "\uE014",
"ARROW_DOWN" : "\uE015",
"INSERT" : "\uE016",
"DELETE" : "\uE017",
"SEMICOLON" : "\uE018",
"EQUALS" : "\uE019",
"NUMPAD0" : "\uE01A",
"NUMPAD1" : "\uE01B",
"NUMPAD2" : "\uE01C",
"NUMPAD3" : "\uE01D",
"NUMPAD4" : "\uE01E",
"NUMPAD5" : "\uE01F",
"NUMPAD6" : "\uE020",
"NUMPAD7" : "\uE021",
"NUMPAD8" : "\uE022",
"NUMPAD9" : "\uE023",
"MULTIPLY" : "\uE024",
"ADD" : "\uE025",
"SEPARATOR" : "\uE026",
"SUBTRACT" : "\uE027",
"DECIMAL" : "\uE028",
"DIVIDE" : "\uE029",
"F1" : "\uE031",
"F2" : "\uE032",
"F3" : "\uE033",
"F4" : "\uE034",
"F5" : "\uE035",
"F6" : "\uE036",
"F7" : "\uE037",
"F8" : "\uE038",
"F9" : "\uE039",
"F10" : "\uE03A",
"F11" : "\uE03B",
"F12" : "\uE03C",
"COMMAND" : "\uE03D",
"META" : "\uE03D"
}
A simple way of doing this is to use .keys() method name and then to pass the key name you want to press.
For example: The below command will press the Down arrow key.
.keys(browser.Keys.ARROW_DOWN)
I think the keys method from Selenium protocol will be the one you need:
http://nightwatchjs.org/api#keys
You should pass the controller in sendKeys funtion.
Like This.
elements: {
textBoxSearch: {
selector: '.nav-search-input'
},
.sendKeys('#textBoxSearch',client.Keys.ENTER);

Move the value along with the handle in dijit/form/HorizontalSlider

Currently i am getting the values upon sliding but I want to display the values along with the handle in dojo horizontal slider.
I am creating the slider like this
var slider = new HorizontalRangeSlider({
name : "slider",
value : startValue,
//starting and end values to the slider
minimum : endValue,
maximum : endValue,
intermediateChanges : true,
showButtons : false,
onChange : lang.hitch(this, "setValues")
}, this.slider).startup();
var sliderLabelsRule = new HorizontalRule({
container : "topDecoration",
style:"height:5px",
count : 2,
numericMargin: 1
}, this.sliderRule);
this.sliderLabelsRule.startup();
//create the labels object
var sliderLabelsTop = new HorizontalRuleLabels({
container : "topDecoration",
style : "font-size: 14px;",
//array that contains the label values
labels : array,
}, this.sliderLabelsTop);
sliderLabelsTop.startup();
And the template is like this
<div>
<div data-dojo-attach-point="slider">
<div data-dojo-attach-point="sliderRule"></div>
<ol data-dojo-attach-point="sliderLabelsTop"></ol>
</div>
</div>
Now i have to display the value upon sliding the slider rule just below the slider handle, How to do this in dojo?
We can make use of the HorizontalRangeSlider attach points and we can place the value that you want to show by placing there.
HorizontalSRangeSlider has two attach point sliderHandle and sliderHandleMax,we can place the value there like this,
this.horizontalSlider = new HorizontalRangeSlider({
name : "slider",
value : this.sliderMinMax,
minimum : this.sliderMinMax[0],
maximum : this.sliderMinMax[1],
intermediateChanges : false,
showButtons : false,
onChange : lang.hitch(this, "callOnchange")
}, this.slider);
this.horizontalSlider.startup();
this.horizontalSliderRule = new HorizontalRule({
container : "topDecoration",
style:"height:5px",
count : 2,
numericMargin: 1
}, this.sliderRule);
this.horizontalSliderRule.startup();
this.horizontalSliderRule.sliderHandle.innerHTML = value //your value to show

Titanium search view nor sorting out

I 'm using Android Titanium Appcelerator.
I had created a search bar for a tableview but it does not sorting the table values, please help:
var search = Titanium.UI.createSearchBar({
showCancel : false,
});
TableView = Ti.UI.createTableView({
search : search,
searchHidden : true,
filterAttribute : 'filter',
});
And I have added filter = contents; inside my rowview.
This is the basic code. I append all the text I want to search on into the filter of the tableRow definition. I then set the filter attribute of my tableROW to the filterAttribute of the tableVIEW.
var tableRow = Ti.UI.createTableViewRow({
height : '70dp',
layout : 'vertical',
filter : filterByThis1 + ' ' + filterByThis2
});
var search = Ti.UI.createSearchBar({});
var tableView = Ti.UI.createTableView({
filterAttribute : 'filter',
search : search
});