Code:
src: {
_base: "Edit",
Disabled: "Blank"
}
src: {
_base: "Edit",
Disabled: "Blank"
}
// - no cssClass in _base means it's using FormItem.iconBaseStyle, which is "icon"
// - with showOver: true, no Over entry below means you get the _base image, Edit, with iconOver
src: {
_base: "Edit",
Disabled: "Edit:color:transparent;"
},
// On the icon itself - it might seem like this should work, but we don't provide arbitrary settings like
// "disabled" on targets in the ruleScope - we will be adding a ruleContext accessor, something like
// isDisabled.<i>componentId</i>, but that won't be in the next day or two. So this will not work:
//visibleWhen: { fieldName: "form.disabled", value: false },
// however, this will work, on the icon
showIf : function (form, item) {
if (item.disabled || (item.disabled == null && form.disabled)) return false;
return true;
},
// but, right now, it requires the item to be refreshed on state-change
updateState : function () {
this.Super("updateState", arguments);
this.redraw();
},
var form = isc.DynamicForm.create({
ID: "testForm",
autoDraw: false,
items: [{
name: "search",
title: "Search Term",
width: 200,
icons: [
{
name: "edit",
src: {
_base: "Edit",
//Over:"Edit:cssClass:icon;",
Disabled: "Edit:color:transparent;"
},
inline: true,
showOver: true,
showDisabled: true,
showFocused: false,
prompt: 'edit'
}
]
}]
});
isc.VStack.create({
width: "100%",
members: [form]
});
Over:"Edit:cssClass:icon;",
var form = isc.DynamicForm.create({
ID: "testForm",
autoDraw: false,
items: [{
name: "search",
title: "Search Term",
width: 200,
icons: [
{
name: "edit",
src: {
_base: "Edit",
Over: "Edit:color:yellow;",
Disabled: "Edit:color:red;"
},
inline: true,
showOver: true,
showDisabled: true,
showFocused: false,
prompt: 'edit'
}
]
}]
});
isc.VStack.create({
width: "100%",
members: [form]
});
Edit:1 GET https://www-demos.smartclient.com/smartclient-13.1/isomorphic/system/reference/exampleImages/Edit 404 (Not Found)
Edit:color:yellow;:1 GET https://www-demos.smartclient.com/smartclient-13.1/isomorphic/system/reference/exampleImages/Edit:color:yellow; 404 (Not Found)
Edit:1 GET https://www-demos.smartclient.com/smartclient-13.1/isomorphic/system/reference/exampleImages/Edit 404 (Not Found)
testForm.getItem("search").setDisabled(true)
undefined
Edit:color:red;:1 GET https://www-demos.smartclient.com/smartclient-13.1/isomorphic/system/reference/exampleImages/Edit:color:red; 404 (Not Found)
isc.StyleSheetHandler.create({
autoLoad: true,
cssText: ".myIcon {color: red;} .myIconOver {color: green;} .myIconDisabled {color: yellow;} "
});
var form = isc.DynamicForm.create({
ID: "testForm",
autoDraw: false,
items: [{
name: "search",
title: "Search Term",
width: 200,
icons: [
{
name: "edit",
src: "Edit:cssClass:myIcon;",
showOver: true,
showFocused: false,
prompt: 'edit'
}
]
}]
});
isc.VStack.create({
width: "100%",
members: [form]
});
Leave a comment: