Solved

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

Posted on 2016-10-19
4
40 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 54

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 54

Expert Comment

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

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

808 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