public onListViewUpdated(event: IListViewCommandSetListViewUpdatedParameters) : void {
this.Log('Start onListViewUpdated');
var selectedRowCount: Number = event.selectedRows.length;
// commands are enabled only if one item is selected
var hasSingleSelection: boolean = selectedRowCount == 1;
this._setCommandEnabled(hasSingleSelection);
I see you are using deprecatedonListViewUpdated(event: IListViewCommandSetListViewUpdatedParameters), whilst my goal is to make my code working with the new listViewStateChangedEvent.
The issue #7845 already has a fix and is being slowly rolled out. Still doesn't work in my tenant, but any day now, I think =)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Try this:
public onListViewUpdated(event: IListViewCommandSetListViewUpdatedParameters) : void {
this.Log('Start onListViewUpdated');
}
private _setCommandEnabled(commandId:string, enabled: boolean) : void {
this.Log(
Start _setCommandEnabled commandId: ${commandId} enabled: ${enabled});const command: Command = this.tryGetCommand(commandId);
if (command) {
command.disabled = !enabled;
}
}
Thank you @ukurze for weighing in :)
I see you are using deprecated
onListViewUpdated(event: IListViewCommandSetListViewUpdatedParameters), whilst my goal is to make my code working with the new listViewStateChangedEvent.The issue #7845 already has a fix and is being slowly rolled out. Still doesn't work in my tenant, but any day now, I think =)