jQWidgets Forums

jQuery UI Widgets Forums Grid Disable button in Grid Toolbar

This topic contains 2 replies, has 2 voices, and was last updated by  nja 9 years, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Disable button in Grid Toolbar #81203

    nja
    Participant

    Hi,
    I have set the disabled property of my button to true, but the click event is still being triggered…. The button is in the toolbar of the grid. It shows as disabled, but then when you click on it the modal pops up.

    Can you see if there is something obvious I am missing?

    thanks,
    nja

    == Initializing the button

    var saveButton = $("<div style='float: left; margin: 5px;'><span style='margin-left: 4px; position: relative; '>Save</span></div>");
    container.append(saveButton);
    
    toolbar.append(container);

    == inside the rendertoolbar: function (toolbar)

    if ("<?php echo $this->item->status ?>" == "Submitted") {
    	saveButton.jqxButton({ width: 60, height: 15, theme: 'darkblue', disabled: true });
    
    }
    else {
    	saveButton.jqxButton({ width: 60, height: 15, theme: 'darkblue' });
    	
    }

    == Click event

    saveButton.click(function (event) {
    		//close any cell open for editing
    		var cell = $('#jqxgrid').jqxGrid('getselectedcell');
    		if ((typeof(cell)!='undefined') && (cell != null)){
    			var editable = $("#jqxgrid").jqxGrid('endcelledit', cell.rowindex, cell.datafield, false);
    
    		}
    
    		// open save dialog 
    		$('#myIsDirtyModal').modal({ keyboard: false });                       
    
    });
    Disable button in Grid Toolbar #81234

    ivailo
    Participant

    Hi nja,

    In your demo you initializes the widget from div. This is the reason about that behavior.
    You have to initialize the jqxButton from button or input tag.

    Here is a demo.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Disable button in Grid Toolbar #81259

    nja
    Participant

    Well, that makes sense. I will give that a try.

    Thanks,
    nja

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.