Agreed, should be in the TypeScript documentation. Is this just one case of a more general rule though? I seem to recall (but not specifically offhand) that there are other things that are created by defining an array of plain old JavaScript objects, some of which might have specific types associated with them.
Announcement
Collapse
No announcement yet.
X
-
There are ListGrid, TreeGrid and DetailViewer fields, but these do not have subtypes. There are also some cases in which it would come up in the Dashboards and Tools system. We would recommend discussing it as needed for DF.items, but applicable to other cases, such as where Canvas Properties are specified and you want to use type-checking for ListGrid properties.
Comment
-
This page: http://www.smartclient.com/smartclie....TileGrid.data says that the setter for TileGrid.data is TileGrid.setData(). However, there does not seem to be a TileGrid.setData() in the docs. Is it just missing from the docs?
Comment
-
RichTextItem defines the colSpan property defining it as number | string. This overrides the base FormItem colSpan which is defined as simply number. I understand that sometimes there is a reason to override a property with a different type but in this case is there a reason? Same goes for ToolbarItem.
Comment
-
This is definitely good news, although it does bring up some questions:
1. Previously, when generating types, I was not looking at the baseType attribute (I was using it for properties and method parameters). With the introduction of Constant, I realized that I should look at the baseType because Constant has a baseType='string' which is what it is.... Great. Now I am looking at the baseType when generating types but that messed me up because a Callback has a baseType='string'. Well, I know that in some cases a Callback can be specified as a string but it is not fundamentally a string. So, I've put a new rule in to make sure that Callback is still specified as any. I think a better way to handle it would be to leave the baseType off from Callback and in the cases when a parameter can take an actual Callback or a string, it should be defined as: Callback | string.
2. Now that I'm looking at the baseType attribute for types, I came across a baseType='Identifier' (for GlobalId) and baseType='SCImgURL' (for SCSpriteConfig). I thought baseType would only ever be string, and if it was expanded, it would be some other actual JavaScript type (number, boolean, object etc.) If baseType is going to take on other made-up types, it loses (what I thought was) its purpose which is to map an ISC type back to the fundamental JavaScript type for code generation.
3. There are several types which probably should have a baseType='string' such as:- KeyName - Strings to identify the various keys on the keyboard.
- RelativeDateShortcut - A RelativeDateShortcut is a special string ...
- AutoTestLocator - An autoTestLocator is an xpath-like string ....
Comment
-
1. we'll check on this
2. you are intended to look at the baseType for the other type, and you'll ultimately arrive at string or some other atomic type (right now they are all string however)
3. we'll check on these
4. this might have slipped through form internal processing, we'll look at it
Yes, those states are supposed to be blank.
Comment
-
1. Great, thanks.
2. I've really got to question the thinking on this one. Why make a code generator go through hoops to back-track to the atomic type? This is not meant as a sub-classing system. It's just meant to aid in code generation and the easiest thing to do for code generation is to just put in the atomic type.
3. Great, thanks.
4. Ahhhh... so that might just be an intermediate value, ok. I'll just ignore it.
Comment
Comment