Mar 23, 2013, 7:45 PM
[CLOSED] DataGrid only rendering partial values ( version 2.2)
Hello All,
I have a DataGrid with Livesearchplugin as follows
When the page is loaded and executed, we can see the method is returning the new configuration and data as image "DataGrid" shows
However the Grid doesnot render the values as shown here
However other times it does render portion of data as shown here
I am not sure what is going wrong, no js errors are thrown.
Any help is appreciated
Thanks
Amir
I have a DataGrid with Livesearchplugin as follows
Html.X().GridPanel().ID("wsGridPanel").Height(500)
.Store(Html.X().Store().ID("wsGridStore").Model(Html.X().Model()))
.Plugins(Html.X().LiveSearchGridPanel())
.TopBar(Html.X().LiveSearchToolbar()
.Items(Html.X().Button()
.Text("Search")
.ToolTip("Yellow highlight")
.IconCls("x-yellow-highlight")
.Pressed(true)
.EnableToggle(true)
.ToggleGroup("highlightColor")
.ToggleHandler("function(b, state) {if(state) {this.up('wsGridPanel').liveSearchPlugin.matchCls = 'x-livesearch-match';}}")
The following Code reconfigures and resets the the datagrid based on a datatable // recreate columns
foreach (DataColumn dsColumn in dataTable.Columns)
{
ModelField field = new ModelField(dsColumn.ColumnName, ModelFieldType.Auto);
store.AddField(field);
Column newCol = new Column
{
Text = dsColumn.ColumnName,
DataIndex = dsColumn.ColumnName,
Sortable = true
};
if (dsColumn.ColumnName.ToLower().Contains("amount"))
{
newCol.Renderer.Fn = "moneyColorRenderer";
}
else
{
if (dsColumn.ColumnName.ToLower().Contains("date"))
{
newCol.Renderer.Format = RendererFormat.Date;
}
}
wsGridPanel.AddColumn(newCol);
for (int i = 0; i < dataTable.Rows.Count; i++)
{
store.LoadData(dataTable.Rows[i].ItemArray, false);
}
}
return this.Direct();
}
This method uses the following DataModel public class DataModel
{
[Display(Name = "Method")]
public string SelectedTableValue { get; set; }
public int SelectedService { get; set; }
}
When the page is loaded and executed, we can see the method is returning the new configuration and data as image "DataGrid" shows
However the Grid doesnot render the values as shown here
However other times it does render portion of data as shown here
I am not sure what is going wrong, no js errors are thrown.
Any help is appreciated
Thanks
Amir
Last edited by Daniil; Mar 25, 2013 at 3:30 PM.
Reason: [CLOSED]