X-Editable Widget

I am unsure how to use ‘apply’ in the X-editable widget to prevent an attribute from being editable. The documentation says as long as the attribute is not safe then it will not be editable (if I understand correctly). In my Client model I list a number of attributes as ‘safe’ however business_country is not listed.

The other option according to the X-editable documentation is to use the option of ‘apply’ or ‘disable’ passed as configuration array. If I want to make business_country NOT editable what is the correct syntax. Currently I am using




<?php $this->widget('bootstrap.widgets.TbEditableDetailView', array(

    'id' => 'client-details',

    'data' => $model,

    'url' => $this->createUrl('client/editable'),  //common submit url for all editables

    'attributes'=>array(

	    'business_address',

	    'business_suburb',

	    'business_postcode',

	    array(

	    'name'=>'business_state',

	    'value'=>$model->business_state,

	    'editable'=>array(

	    	'type'=>'select',  	

	    	'source'=>CHtml::listData(StateOptions::model()->findAll(), 'name', 'name'))),

		array(

			'name'=>'business_country',

			'apply'=>false),

    ),

));

?>



However business_country is still editable. Any suggestions as to what I am doing wrong?

No one has yet found a solution for this , i am having the same issue

Simple example :


        array(

            'name' => 'name',

            'type' => 'raw',

            'editable' => array(

                'title'=>'title',

                'apply' => false/true,

            ),

        ),




array(

    	'name' => 'ABN',

    	'editable' => array(

    		'enabled' => false,

    		)

    	),



This worked for me - the attribute was not set as Safe in model