|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.smartgwt.client.core.JsObject
com.smartgwt.client.core.DataClass
com.smartgwt.client.core.RefDataClass
com.smartgwt.client.data.Record
com.smartgwt.client.widgets.grid.ListGridRecord
public class ListGridRecord
A ListGridRecord is a JavaScript Object whose properties contain values for each ${isc.DocUtils.linkForRef('object:ListGridField')}. A ListGridRecord may have additional properties which affect the record's appearance or behavior, or which hold data for use by custom logic or other, related components.
For example a ListGrid that defines the following fields:
fields : [ {name: "field1"}, {name: "field2"} ],Might have the following data:
data : [ {field1: "foo", field2: "bar", customProperty:5}, {field1: "field1 value", field2: "field2 value", enabled:false} ]Each line of code in the
data
array above creates one JavaScript Object via
JavaScript {type:ObjectLiteral,object literal} notation. These JavaScript Objects are
used as ListGridRecords.
Both records shown above have properties whose names match the name property of a
ListGridField, as well as additional properties. The second record will be disabled due to
enabled:false
; the first record has a property "customProperty" which will
have no effect by default but which may be accessed by custom logic.
After a ListGrid is created and has loaded data, records may be accessed via
data
, for example, listGrid.data.get(0) retrieves the first record.
ListGridRecords are also passed to many events, such as
ListGrid.addCellClickHandler(com.smartgwt.client.widgets.grid.events.CellClickHandler)
.
A ListGridRecord is always an ordinary JavaScript Object regardless of how the grid's dataset is loaded (static data, java server, XML web service, etc), and so supports the normal behaviors of JavaScript Objects, including accessing and assigning to properties via dot notation:
var fieldValue = record.fieldName; record.fieldName = newValue;
Note however that simply assigning a value to a record won't cause the display to be
automatically refreshed - ListGrid.refreshCell(int, int)
needs to be called. Also,
consider 'editValues vs saved values'
when directly modifying
ListGridRecords.
See the attributes in the API tab for the full list of special properties on ListGridRecords that will affect the grid's behavior.
Field Summary |
---|
Fields inherited from class com.smartgwt.client.core.JsObject |
---|
jsObj |
Constructor Summary | |
---|---|
ListGridRecord()
|
|
ListGridRecord(com.google.gwt.core.client.JavaScriptObject jsObj)
|
Method Summary | |
---|---|
java.lang.Boolean |
getCanAcceptDrop()
When set to false , other records cannot be dropped on (i.e., inserted
via drag and drop) immediately before this record. |
java.lang.Boolean |
getCanDrag()
When set to false , this record cannot be dragged. |
java.lang.Boolean |
getEnabled()
Default property name denoting whether this record is enabled. |
java.lang.Boolean |
getIsSeparator()
Default property name denoting a separator row. When set to true , defines a horizontal separator in the listGrid
object. |
java.lang.String |
getLinkText()
The HTML to display in this row for fields with fieldType set to link. |
static ListGridRecord |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
|
java.lang.String |
getSingleCellValue()
Default property name denoting the single value to display for all fields of this row. If this property is set for some record, the record will be displayed as a single cell spanning every column in the grid, with contents set to the value of this property. Note: this attribute name is governed by singleCellValueProperty . |
void |
setCanAcceptDrop(java.lang.Boolean canAcceptDrop)
When set to false , other records cannot be dropped on (i.e., inserted
via drag and drop) immediately before this record. |
void |
setCanDrag(java.lang.Boolean canDrag)
When set to false , this record cannot be dragged. |
void |
setEnabled(java.lang.Boolean enabled)
Default property name denoting whether this record is enabled. |
void |
setIsSeparator(java.lang.Boolean isSeparator)
Default property name denoting a separator row. When set to true , defines a horizontal separator in the listGrid
object. |
void |
setLinkText(java.lang.String linkText)
The HTML to display in this row for fields with fieldType set to link. |
void |
setSingleCellValue(java.lang.String singleCellValue)
Default property name denoting the single value to display for all fields of this row. If this property is set for some record, the record will be displayed as a single cell spanning every column in the grid, with contents set to the value of this property. Note: this attribute name is governed by singleCellValueProperty . |
Methods inherited from class com.smartgwt.client.data.Record |
---|
convertToRecordArray |
Methods inherited from class com.smartgwt.client.core.RefDataClass |
---|
getRef, getRef |
Methods inherited from class com.smartgwt.client.core.JsObject |
---|
isCreated, setJsObj |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ListGridRecord()
public ListGridRecord(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail |
---|
public static ListGridRecord getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public void setEnabled(java.lang.Boolean enabled)
recordEnabledProperty
.
enabled
- enabled Default value is nullpublic java.lang.Boolean getEnabled()
recordEnabledProperty
.
public void setIsSeparator(java.lang.Boolean isSeparator)
true
, defines a horizontal separator in the listGrid
object. Typically this is specified as the only property of a record object, since a
record with isSeparator:true
will not display any values.isSeparatorProperty
.
isSeparator
- isSeparator Default value is nullpublic java.lang.Boolean getIsSeparator()
true
, defines a horizontal separator in the listGrid
object. Typically this is specified as the only property of a record object, since a
record with isSeparator:true
will not display any values.isSeparatorProperty
.
public void setSingleCellValue(java.lang.String singleCellValue)
singleCellValueProperty
.
singleCellValue
- singleCellValue Default value is nullpublic java.lang.String getSingleCellValue()
singleCellValueProperty
.
public void setCanDrag(java.lang.Boolean canDrag)
false
, this record cannot be dragged. If canDrag is false for
any record in the current selection, none of the records will be draggable.
canDrag
- canDrag Default value is nullpublic java.lang.Boolean getCanDrag()
false
, this record cannot be dragged. If canDrag is false for
any record in the current selection, none of the records will be draggable.
public void setCanAcceptDrop(java.lang.Boolean canAcceptDrop)
false
, other records cannot be dropped on (i.e., inserted
via drag and drop) immediately before this record.
canAcceptDrop
- canAcceptDrop Default value is nullpublic java.lang.Boolean getCanAcceptDrop()
false
, other records cannot be dropped on (i.e., inserted
via drag and drop) immediately before this record.
public void setLinkText(java.lang.String linkText)
linkText
.
linkText
- linkText Default value is nullpublic java.lang.String getLinkText()
linkText
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |