Solved

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

Posted on 2016-10-19
4
25 Views
Last Modified: 2016-10-20
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

img002
When  only using "Modal view"  the control isn't disabled.
0
Comment
Question by:Eduardo Fuerte
  • 2
  • 2
4 Comments
 
LVL 51

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 41850525
The only way to solve this is to find out what is disabling them and address that. You can't set a control to never be disabled.
0
 

Author Comment

by:Eduardo Fuerte
ID: 41851853
@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.
img001
Something a little obvious.

That's solved by your assistance (and patience with so repeated questions)
0
 

Author Closing Comment

by:Eduardo Fuerte
ID: 41851856
Thank you for assistance!
0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 41851875
You are always welcome Eduardo, well done on nailing it.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now