2

I'm new to Yii2 framework. I have this Business view page like this.. enter image description here Where for now a user can sort with all the four i.e business name, address, contact number and created date. I want to disable the sorting option for address and contact number. I found some options like 'sort' => false, but did not understand in which part of the code I should use it. Should I have to include the code in models? or controllers? or in the forms? Please help. Any guidance will be greatly appreciated.

1
  • 1
    'enableSorting' => false, Commented Aug 11, 2015 at 5:00

1 Answer 1

1

Using enableSorting => false disable sorting for particular column of GridView . E.g.

   [
       'label' => 'Address',
       'attribute' => 'address',
       'enableSorting' => false,
    ],
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.