|
|||||||||
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(JavaScriptObject jsObj)
|
Method Summary | |
---|---|
String |
get_baseStyle()
Name of a CSS style to use as the baseStyle for all cells
for this particular record. |
Boolean |
getCanAcceptDrop()
When set to false , other records cannot be dropped on (i.e., inserted via drag and drop) immediately before
this record. |
Boolean |
getCanDrag()
When set to false , this record cannot be dragged. |
Boolean |
getCanExpand()
Default property name denoting whether this record can be expanded. |
String |
getCustomStyle()
Name of a CSS style to use for all cells for this particular record. |
DataSource |
getDetailDS()
The default value of recordDetailDSProperty . |
Boolean |
getEnabled()
Default property name denoting whether this record is enabled. |
Boolean |
getIncludeInSummary()
If specified as false this record should be ignored when calculating summary totals to be shown in the 'summary row' for this grid. |
Boolean |
getIsGridSummary()
This attribute will automatically be set to true for the record representing the grid-level summary row shown if showGridSummary is true. |
Boolean |
getIsGroupSummary()
This attribute will automatically be set to true for records representing group-level summary rows shown if showGroupSummary is true. |
Boolean |
getIsSeparator()
Default property name denoting a separator row. When set to true , defines a horizontal separator in the
listGrid object. |
String |
getLinkText()
The HTML to display in this row for fields with fieldType set to link. |
static ListGridRecord |
getOrCreateRef(JavaScriptObject jsObj)
|
String |
getSingleCellValue()
Default property name denoting the single value to display for all fields of this row. |
void |
set_baseStyle(String _baseStyle)
Name of a CSS style to use as the baseStyle for all cells
for this particular record. |
void |
setCanAcceptDrop(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(Boolean canDrag)
When set to false , this record cannot be dragged. |
void |
setCanExpand(Boolean canExpand)
Default property name denoting whether this record can be expanded. |
void |
setCustomStyle(String customStyle)
Name of a CSS style to use for all cells for this particular record. |
void |
setDetailDS(DataSource detailDS)
The default value of recordDetailDSProperty . |
void |
setEnabled(Boolean enabled)
Default property name denoting whether this record is enabled. |
void |
setIncludeInSummary(Boolean includeInSummary)
If specified as false this record should be ignored when calculating summary totals to be shown in the 'summary row' for this grid. |
void |
setIsGridSummary(Boolean isGridSummary)
This attribute will automatically be set to true for the record representing the grid-level summary row shown if showGridSummary is true. |
void |
setIsGroupSummary(Boolean isGroupSummary)
This attribute will automatically be set to true for records representing group-level summary rows shown if showGroupSummary is true. |
void |
setIsSeparator(Boolean isSeparator)
Default property name denoting a separator row. When set to true , defines a horizontal separator in the
listGrid object. |
void |
setLinkText(String linkText)
The HTML to display in this row for fields with fieldType set to link. |
void |
setSingleCellValue(String singleCellValue)
Default property name denoting the single value to display for all fields of this row. |
Methods inherited from class com.smartgwt.client.data.Record |
---|
convertToRecordArray, getAttributeAsRecordArray, getAttributeAsRecordList |
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(JavaScriptObject jsObj)
Method Detail |
---|
public static ListGridRecord getOrCreateRef(JavaScriptObject jsObj)
public void setEnabled(Boolean enabled)
recordEnabledProperty
.
enabled
- enabled Default value is nullpublic Boolean getEnabled()
recordEnabledProperty
.
public void setCanExpand(Boolean canExpand)
canExpandRecordProperty
.
canExpand
- canExpand Default value is nullpublic Boolean getCanExpand()
canExpandRecordProperty
.
public void setIsSeparator(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 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 setCustomStyle(String customStyle)
Note that using this property assigns a
single, fixed style to the record, so rollover and selection styling are disabled. To provide a series of stateful
styles for a record use _baseStyle
instead.
See com.smartgwt.client.widgets.grid.ListGrid#getCellStyle
for an overview of various ways to customize styling,
both declarative and programmatic.
If this property is changed after draw(), to refresh the grid call ListGrid.refreshRow(int)
(or ListGrid.markForRedraw()
if several rows are being refreshed).
If your application's
data uses the "customStyle" attribute for something else, the property name can be changed via recordCustomStyleProperty
.
customStyle
- customStyle Default value is nullpublic String getCustomStyle()
Note that using this property assigns a
single, fixed style to the record, so rollover and selection styling are disabled. To provide a series of stateful
styles for a record use _baseStyle
instead.
See com.smartgwt.client.widgets.grid.ListGrid#getCellStyle
for an overview of various ways to customize styling,
both declarative and programmatic.
If this property is changed after draw(), to refresh the grid call ListGrid.refreshRow(int)
(or ListGrid.markForRedraw()
if several rows are being refreshed).
If your application's
data uses the "customStyle" attribute for something else, the property name can be changed via recordCustomStyleProperty
.
public void set_baseStyle(String _baseStyle)
baseStyle
for all cells
for this particular record. The styleName specified with have suffixes appended to it as the record changes state
("Over", "Selected" and so forth) as described by com.smartgwt.client.widgets.grid.ListGrid#getCellStyle
. For a
single, fixed style for a record, use customStyle
instead.
See com.smartgwt.client.widgets.grid.ListGrid#getCellStyle
for an overview of various ways to
customize styling, both declarative and programmatic.
If this property is changed after draw(), to refresh the grid
call ListGrid.refreshRow(int)
(or ListGrid.markForRedraw()
if several rows are being refreshed).
If your application's
data uses the "_baseStyle" attribute for something else, the property name can be changed via recordBaseStyleProperty
.
_baseStyle
- _baseStyle Default value is nullpublic String get_baseStyle()
baseStyle
for all cells
for this particular record. The styleName specified with have suffixes appended to it as the record changes state
("Over", "Selected" and so forth) as described by com.smartgwt.client.widgets.grid.ListGrid#getCellStyle
. For a
single, fixed style for a record, use customStyle
instead.
See com.smartgwt.client.widgets.grid.ListGrid#getCellStyle
for an overview of various ways to
customize styling, both declarative and programmatic.
If this property is changed after draw(), to refresh the grid
call ListGrid.refreshRow(int)
(or ListGrid.markForRedraw()
if several rows are being refreshed).
If your application's
data uses the "_baseStyle" attribute for something else, the property name can be changed via recordBaseStyleProperty
.
public void setSingleCellValue(String singleCellValue)
singleCellValueProperty
.
singleCellValue
- singleCellValue Default value is nullpublic String getSingleCellValue()
singleCellValueProperty
.
public void setCanDrag(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 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(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 Boolean getCanAcceptDrop()
false
, other records cannot be dropped on (i.e., inserted via drag and drop) immediately before
this record.
public void setLinkText(String linkText)
linkText
.
linkText
- linkText Default value is nullpublic String getLinkText()
linkText
.
public void setDetailDS(DataSource detailDS)
recordDetailDSProperty
.
Note : This is an advanced setting
detailDS
- detailDS Default value is nullpublic DataSource getDetailDS()
recordDetailDSProperty
.
public void setIncludeInSummary(Boolean includeInSummary)
'summary row'
for this grid. Note that
includeInTotals
is the default property name for this attribute, but it may be modified via
${isc.DocUtils.linkForRef('listGrid.includeInTotalsProperty')}.
includeInSummary
- includeInSummary Default value is nullpublic Boolean getIncludeInSummary()
'summary row'
for this grid. Note that
includeInTotals
is the default property name for this attribute, but it may be modified via
${isc.DocUtils.linkForRef('listGrid.includeInTotalsProperty')}.
public void setIsGridSummary(Boolean isGridSummary)
showGridSummary
is true. Note that
isGridSummary
is the default property name for this attribute but it may be modified by setting gridSummaryRecordProperty
isGridSummary
- isGridSummary Default value is nullpublic Boolean getIsGridSummary()
showGridSummary
is true. Note that
isGridSummary
is the default property name for this attribute but it may be modified by setting gridSummaryRecordProperty
public void setIsGroupSummary(Boolean isGroupSummary)
showGroupSummary
is true. Note that
isGroupSummary
is the default property name for this attribute but it may be modified by setting groupSummaryRecordProperty
isGroupSummary
- isGroupSummary Default value is nullpublic Boolean getIsGroupSummary()
showGroupSummary
is true. Note that
isGroupSummary
is the default property name for this attribute but it may be modified by setting groupSummaryRecordProperty
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |