Quantcast
Channel: Northwoods Software - Latest topics
Viewing all articles
Browse latest Browse all 7417

Enable/Disable a button programatically

$
0
0

@nitin291989 wrote:

How to enable/disable a button programatically?

Requirement:

1. Initially, button should be disabled.
2. Enable/Disable it separately.

I have defined by button like this:

myBottomBar =
	$(go.Diagram, "myBottomBarDiv",
	{
		isReadOnly: true,
		"animationManager.isEnabled": false,
		contentAlignment: go.Spot.TopRight,
		allowHorizontalScroll: false,
		allowVerticalScroll: false,
		allowZoom: false,
		padding: 0
	});

myBottomBar.add(
	$(go.Part, go.Panel.Horizontal,
				
			$("Button",
					{
				margin: 5,
				click: function() {
					if (dataModified == true) {
						dataModified = false;
					}
					
					resetDiagram = true;
					
					mainDiv.style.display = mainDivDisplay;																						
					treeGridParentDiv.removeChild(goFirst);
					ganttDiagramParentDiv.removeChild(goSecond);											  
					mainDiagramDiv.removeChild(treeGridParentDiv);
					mainDiagramDiv.removeChild(ganttDiagramParentDiv);											  
					mainDiv.removeChild(mainDiagramThird);
					mainDiv.removeChild(mainDiagramForth);
					mainDiv.removeChild(mainDiagramDiv.domNode);											
					meUpdateUI.startup();										
				} 
					},
					$(go.TextBlock, "Reset", { margin: 2 })
			)
		)
	)

Posts: 10

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7417

Trending Articles