Nested List toolbar - sencha-touch

I am creating a nested list and setting the BackText on item tap using "setBackText()". That works fine.
But at the same time, I want the title of the toolbar to be set as well.
The code:
onItemTap : function(nestedList, list, index, node, record, e) {
var partsOfStr = record.get('text').split(';');
val = partsOfStr[2];
currDocument = val;
Ext.getCmp('nestedList').setTitle('HII');
Ext.getCmp('nestedList').setBackText(currDocument);
},
does not seem to be working for me.
Any suggestions?
Thanks in advance.

updateTitleText is by default set to true for nestedlist, so if you are using a data store to set the data for your nestedlist, your title will always be set according to which category of data you are selecting.
So, set
updateTitleText: false
and then try to set the title dynamically like this,
Ext.getCmp('nestedList').setTitle('HII');

Related

Remove "MIME type" column from Filent Content List

I am Using a Script Adapter by passing payload to get contend for a Content List from "Search with values" event
When Contend get loaded to content list , i have a custom view to preview them. But if i clicked on MIME type column , It opens a separate view with the mapped viewer
So I need to remove this column or make it un-clickable
1) I am passing search values to content list's "Search with values" event , from where can i handle Content List's contend loading ,any Dojo Event i can use ?
2) With Script Adapter can i do this without going for a "response filter"
Edit :
As Nicely explained by "Ivo Jonker" (in his answer - "or try to specifically locate the widgets on your page" and with his example code)
responsed = page.ContentList8.ecmContentList.getResultSet();
var cols = responsed.structure.cells[0];
for (i=cols.length-1; i>0; i--){
var col = cols[i];
if (col.field=="mimeTypeIcon")
cols.splice(i,1);
}
page.ContentList78.ecmContentList.setResultSet(responsed);
I simply remove this row. Thanks Again and lovely blog , hope you keep posting more great articles.
The values passed through the Search With Values event will eventually be handled by the icm.pgwidget.contentlist.dijit.DocumentSearchHandler
that in turn creates a SearchTemplate to execute the search (ecm.model.SearchTemplate.prototype.search). One option would be to aspect/before/around the DocumentSearchHandler#query to manipulat the searchresults and by that way to remove the column.
The wiring however does not provide any handles to achieve this for a specific query-resultset combination leaving you to either fix this on a global scale (icm.pgwidget.contentlist.dijit.DocumentSearchHandler.prototype#query), or try to specifically locate the widgets on your page.
Personally, taking into account #2, i'd go for the responsefilter-option if you feel the global solution wouldn't be a problem, or alternatively i'd personally prefer to create a simple ICM widget that instantiates/implements a "plain" ecm.widget.listView.ContentList and exposes a wire to set the ecm.model.Resultset.
You'd then be able to create your own Searchquery in a scriptadapter, remove the column, and pass the resultset.
The script adapter could be something like:
var scriptadapter=this;
var queryParams={};
queryParams.query = "SELECT * FROM Document where id in /*your list*/";
queryParams.retrieveAllVersions = false;
queryParams.retrieveLatestVersion = true;
queryParams.repository = ecm.model.desktop.repositories[0];
queryParams.resultsDisplay = {
"sortBy": "{NAME}",
"sortAsc": true,
"columns": ["{NAME}"],
"honorNameProperty": true};
var searchQuery = new ecm.model.SearchQuery(queryParams);
searchQuery.search(function(response/*ecm.model.Resultset*/){
//remove the mimeTypeIcon
var cols = response.structure.cells[0];
for (i=cols.length-1; i>0; i--){
var col = cols[i];
if (col.field=="mimeTypeIcon")
cols.splice(i,1);
}
//emit the resultset to your new contentlist, be sure to block the regular synchrounous output of the scriptadapter
scriptadapter.onPublishEvent("icm.SendEventPayload",response);
//The contentlist wire would simply do contentlist.setResultSet(response);
});

Dojo EnhancedGrid and programmatic selection

Here's my problem: in my application I have a Dojo EnhancedGrid, backed up by an ItemFileReadStore. The page flow looks like this:
The user selects a value from a selection list.
The item from the list is posted on a server and then the grid is updated with data from the server (don't ask why, this is how it's supposed to work)
The new item is highlighted in the grid.
Now, the first two steps work like a charm; however, the third step gave me some headaches. After the data is successfully POSTed to the server (via dojo.xhrPost() ) the following code runs:
myGrid.store.close();
myGrid._refresh();
myGrid.store.fetch({
onComplete : function(items) {
for ( var i = 0; i < items.length; i++) {
if (items[i].documentType[0].id == documentTypeId) {
var newItemIndex = myGrid.getItemIndex(items[i]);
exportMappingGrid.selection.deselectAll();
exportMappingGrid.selection.addToSelection(newItemIndex);
}
}
}
});
Now, the selection of the grid is updated (i.e. the selection object has a selectedIndex > 0), but visually there's no response, unless I hover the mouse over the "selected" row. If I remove the .deselectAll() line (which I suspected as the culprit) then I sometimes end up with two items selected at once, although the grid selectionMode attribute is set to single.
Any thoughts on this one?
Thanks a lot.
You need to use setSelected(), like so
exportMappingGrid.selection.setSelected(newItemIndex, true);
The second parameter is true to select the row, false to unselect it.
This is what works for me:
grid.selection.clear();
grid.selection.addToSelection(newItemIndex);
grid.selection.getFirstSelected();
Jon

How can I show a summary in the footer of a win grid and not have the Sigma show up in the header?

I'm using an Infragistics UltraWinGrid and would like to be able to display the sum of several columns. I got that working by allowing row summaries. However, I only want them to be able to see the sum, not have all these other crazy options that come along with that little sigma in the header. How can I get rid of this while keeping the sums at the bottom?
You should have the DisplayLayout.Override.AllowRowSummaries property set in this way:
DisplayLayout.Override.AllowRowSummaries = AllowRowSummaries.Default;
then use code like this to create your summary
(Need to check before creating another summary with the same name)
private void BuildCurrencySummary(string name, UltraGridColumn col)
{
SummarySettings ss = grd.DisplayLayout.Bands[0].Summaries.Add(name, SummaryType.Sum, col);
ss.SummaryPositionColumn = col;
ss.SummaryPosition = SummaryPosition.UseSummaryPositionColumn;
ss.Appearance.FontData.Bold = Infragistics.Win.DefaultableBoolean.True;
ss.Appearance.ForeColor = Color.Black;
ss.Appearance.TextHAlign = HAlign.Right;
ss.DisplayFormat = "{0:C}";
}
From Infragistics Forum :
You can still apply summaries to a column without setting the AllowRowSummaries property.
The purpose of the AllowRowSummaries is to show (or not show) the interface for the user to establish their own summaries. This is the "sigma" symbol you were seeing.
From the Override object, set the AllowRowSummaries property to False.
UltraGrid1.DisplayLayout.Override.AllowRowSummaries = Infragistics.Win.UltraWinGrid.AllowRowSummaries.[False]

Set dataSource of ListView programmatically

I'm trying to update a windows 8 application from the Developer Preview to the Consumer Preview. It seems there's been a few changes. This code used to work:
var myDataSource = new WinJS.UI.ArrayDataSource(array)
var basicListView = WinJS.UI.getControl(document.getElementById("basicListView"));
basicListView.dataSource = myDataSource;
Now, there is no WinJS.UI.getControl method and no ArrayDataSource. This is my code:
var dataList = new WinJS.Binding.List(array);
var list = document.getElementById("basicListView");
list.itemDataSource = dataList.dataSource;
but it does nothing (except add a property to a DOM element that is ignored). Any ideas what I'm missing?
Got it. To get the control you now use the winControl property of the element:
var list = document.getElementById("basicListView").winControl;
Setting the itemDataSource works a treat.

How to hide the column header for a Devexpress GridLookUpEdit?

I currently have a DevExpress GridControl where one of the columns have a GridLookUpEdit assigned under ColumnEdit. Yet when I run there is a column name (the display member) that shows up.
I know with a LookUpEdit you can set the column headers to invisible with lookupedit.Properties.ShowHeader = False but I have no clue how to make it invisible for the GridLookUpEdit.
Use:
lookupedit.Properties.View.OptionsView.ShowColumnHeaders = False
Use the following code to hide a column:
gridLookUpEdit1.Properties.View.Columns("SomeFieldName").Visible = false
What you do is run the property editor, go to columns and select the column that your lookupedit is assigned to. Then expand your column edit, then the view within, then the OptionsView. Then set ShowColumnHeaders to false. This will set all of the column headers within the lookupedit to false.
For devexpress 18.2.8
I'm using the following code to hide a column:
using (DataTable dt = rst.ResultSet.Tables[0].Copy())
{
dt.Columns["Unit_ID"].ColumnMapping = MappingType.Hidden;
ddlUnitOfMeasurement.Properties.DataSource = dt.DefaultView;
ddlUnitOfMeasurement.Properties.ValueMember = "Unit_ID";
ddlUnitOfMeasurement.Properties.DisplayMember = "Unit_Name";
}