Please have a look at the attached screen shot. This how DateRangeItem looks by default in ToolStrip. Its apparent that its unconstrained width is twice bigger then necessary to hold formatted date value.
Is there a way to let SmartClient/SmartGwt component to size in accordance with format?
Example to let default values show (and also simulating somewhat ToolStrip.addFormItem in SmartGwt)
isc.DynamicForm.create({
ID: "dateRangeForm",
cellPadding:3,
minWidth:50,
numCols:1,
fields: [
{name: "dateRangeItem", editorType: "DateRangeItem", showTitle: false, allowRelativeDates: false }
]
});
isc.ToolStrip.create({
width: 650,
members: [ dateRangeForm ]
});
Also, another questions about integrating form items into ToolStrip.
Lets say I have a radio button group in the toolstrip, and one of the selected values will set visible on the form wrapping date range item, others will hide the form. What is the best way to implement it?
I have tried directly coding it with click event handler, but ended up with width of the form suddenly expanding such that From became far away from To. In example below, click hide and then show buttons.
isc.DynamicForm.create({
ID: "dateRangeForm",
cellPadding:1,
minWidth:50,
numCols:1,
fields: [
{name: "dateRangeItem", editorType: "DateRangeItem", showTitle: false, allowRelativeDates: false, fieldLayout:'horizontal' }
]
});
isc.ToolStripButton.create({
ID: "showDateRangeButton",
title: "Show",
click: function() {
dateRangeForm.setVisibility('visible')
}
});
isc.ToolStripButton.create({
ID: "hideDateRangeButton",
title: "Hide",
click: function() {
dateRangeForm.setVisibility('hidden')
}
});
isc.ToolStrip.create({
width: '100%',
members: [ showDateRangeButton, hideDateRangeButton, dateRangeForm ]
});
Is there a way to let SmartClient/SmartGwt component to size in accordance with format?
Example to let default values show (and also simulating somewhat ToolStrip.addFormItem in SmartGwt)
isc.DynamicForm.create({
ID: "dateRangeForm",
cellPadding:3,
minWidth:50,
numCols:1,
fields: [
{name: "dateRangeItem", editorType: "DateRangeItem", showTitle: false, allowRelativeDates: false }
]
});
isc.ToolStrip.create({
width: 650,
members: [ dateRangeForm ]
});
Also, another questions about integrating form items into ToolStrip.
Lets say I have a radio button group in the toolstrip, and one of the selected values will set visible on the form wrapping date range item, others will hide the form. What is the best way to implement it?
I have tried directly coding it with click event handler, but ended up with width of the form suddenly expanding such that From became far away from To. In example below, click hide and then show buttons.
isc.DynamicForm.create({
ID: "dateRangeForm",
cellPadding:1,
minWidth:50,
numCols:1,
fields: [
{name: "dateRangeItem", editorType: "DateRangeItem", showTitle: false, allowRelativeDates: false, fieldLayout:'horizontal' }
]
});
isc.ToolStripButton.create({
ID: "showDateRangeButton",
title: "Show",
click: function() {
dateRangeForm.setVisibility('visible')
}
});
isc.ToolStripButton.create({
ID: "hideDateRangeButton",
title: "Hide",
click: function() {
dateRangeForm.setVisibility('hidden')
}
});
isc.ToolStrip.create({
width: '100%',
members: [ showDateRangeButton, hideDateRangeButton, dateRangeForm ]
});
Comment