Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Custom ListGridField editorType / FormItem

    Using SmartClient 8.2.

    I'm wondering if someone could point me in the right direction for how to create a custom FormItem for use as an editor for a field in a ListGrid. What I'd like to do is extend the existing textItem to include some buttons along with the text field. I couldn't find a good example of how to do this in the documentation.

    I'd like to do something like:
    Code:
    	isc.defineClass("MyCustomTextItem", "TextItem").addProperties({
                    ... (what do I need to put here?)
    	});
    ... and in the ListGrid:
    Code:
            fields: [{
                    name: "foo",
                    ...
                    canEdit: true,
                    editorType: "myCustomTextItem",
                    ...
            }]
    Thanks

    #2
    Take a look at the QuickStart Guide for information on subclassing FormItem.

    The usage below is generally correct except the classname is wrong in the editorType setting (bad capitalization).

    Comment


      #3
      Isomorphic, thanks for pointing me in the right direction. What did the trick was something like:

      Code:
      isc.defineClass("TestTextItem", "TextItem").addProperties({
      ...
      });
      isc.DynamicForm.create({
          fields:[{
              name:"userName",
              editorType: isc.TestTextItem
          }]
      });
      My problem was that I wasn't putting the proper value in the "editorType" field. It needs to be my class name (including the "isc.").

      I was under the impression that I needed to have a field containing an identifying string in the properties of the TestTextItem class that could be referenced as a string in the "editorType" field in the DynamicForm (or ListGrid). The above works just fine.

      Comment


        #4
        editorType can be just the String "TestTextItem" or the actual Class Object (isc.TestTextItem as you show below). If you are in "portal mode" (no globals), just TextTextItem unquoted would not work.

        Comment

        Working...
        X