Hi,
Whats the best way to show information (read only) in SmartClient. I know there is DetailViewer object, but thats quite simple looking.
I could think of following options:
-
Using StaticTextItem in Dynamic Forms binded to RestDataSource, but in this case I will not be able to shown multi paragraph items as there is nothing as StaticTextArea in SmartClient, am I right?
-
Use HTML pane to load the HTML page which contains the required information, but I do not want to use HTML. I want to do all this in SmartClient.
Is there some other way? Please suggest whats the best way in SmartClient to show read only dynamic information from database other than DetailViwer.
Looking forward to your suggestions.
Gaurav
I would suggest you go the form route. Define all fields as disabled: true and the form is not editable and still uses the formItem types you desire. You can even define custom disabled CSS classes to make things look just the way you want.
Thanks David for your response.
I even tried what you suggested. When I disable forms fields (by using canEdit:false), it looks good but create another problem.
Problem with this is that lets say that my field is defined to be of x width and y height. In case my text or content of field is more than this dimension then my some content becomes hidden. My field’s dimensions do not increase or shrink according to my content. Is there someway to do that?
Another problem with this is that in case I define my field type to be TextArea and do canEdit:false for that field, it becomes equivalent to TextItem in behavior.
I am sure there must be some easy way to show read only data in elegant way by using this matured smartclient framework.
Please help, I need to get it done ASAP.
Gaurav
You don’t want to use canEdit: false because everything becomes StaticTextItem. Using disabled: true on a field on the form disables it instead and retains the desired field type such as TextAreaItem.
I don’t think you can have the field size change based on the contents - the form is not just an html table layout.
Thanks David for your suggestions.
Can someone suggest something better. I preparing a professional public site using SmartClient, so don’t want to compromise by using disabled forms for read only data.
I would prefer more professional and clean look for read only data. I am sure there must be some way in SmartClient to do that. Please suggest if someone has already done this, as its quite common issue while developing sites.
Looking forward to more suggestions.
Thanks David once again for your great suggestion.
Gaurav
Did you try using ‘readOnly: true’ on the fields? This allows them to scroll and it doesn’t gray them out the way disabled does. I don’t know what it does regarding sizing, however.