Link to home
Start Free TrialLog in
Avatar of Eduardo Fuerte
Eduardo FuerteFlag for Brazil

asked on

Could you point a way to always obligate a view control to be enabled?

Hi Experts

Could you point a way to always obligate a view control to be enabled?


After using a "view modal"  after going to "edit modal" the combo controls are disabled.

View control
<div class="col-xs-8 mb15">
	<label for="fk_cliente_corporativo" class="field-label text-muted mb10">Produto</label>
	<label for="fk_cliente_corporativo" class="validar field select">
		<?php echo $fk_cliente_corporativo;?>
		<i class="arrow double"></i>
	</label>
</div>

Open in new window


  $('#view').on('show.bs.modal', function () {

		console.log("Modal VIEW");

		var file = $("#view #anexo").val();
		var parts = file.split('/');
		var file = parts[parts.length-1];
 
		 
		 $("#view #anexo").val(file);

	});


  $('#edit').on('show.bs.modal', function () {

        console.log("Modal EDIT");
 
	$('#edit input').prop("disabled", false);

       //Using class validar to force the control to be enabled => No success.
	$('#edit .validar').prop("disabled", false);
});

Open in new window

User generated image
When  only using "Modal view"  the control isn't disabled.
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Eduardo Fuerte

ASKER

@Julian

You are completelly right. I finally found that a helper that outputs to the view with code disables controls in the view.

End of the view
	<?php
        echo datatables_crud_modal(array(
            'controller' => 'reclamacao',
            'edit' => array(
                'action' => array(
                    'save' => 'save',
                    'entity' => 'get',   
                    'status' => 'update',
                ),
            ),
            'view' => array(
                'action' => 'view'
            ),
        ));
    ?>

Open in new window


The code commented.
User generated image
Something a little obvious.

That's solved by your assistance (and patience with so repeated questions)
Thank you for assistance!
You are always welcome Eduardo, well done on nailing it.