Yii Framework Forum: How To Work This Code? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How To Work This Code? Rate Topic: -----

#1 User is offline   rajkumar000000 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 88
  • Joined: 18-September 12

Posted 16 February 2013 - 06:11 AM

hi friends....
i want to know that how to work the below code?
$('.categoryFilter').change(function(){
    category = $('.categoryFilter').serialize();
    $.fn.yiiListView.update(
        'ajaxListView',
        {data: category}
    );
});

this code taken from this link.
pls explain the working of this code?
thanks
0

#2 User is offline   clapas 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 21-February 11

Posted 16 February 2013 - 06:50 AM

That code is calling the update() method from yiiListView jQuery plugin whenever any element with class categoryFilter changes (f.e. select inputs).

The serialize() jQuery method takes all data from those inputs and converts them to an encoded query string, suitable for sending the data with an HTTP request.

As for the parameters in the update() call, ajaxListView is the ID of the list view container; and the second is the options map, i.e. the AJAX request options (see jQuery.ajax API manual).

Hope it helps.
1

#3 User is offline   rajkumar000000 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 88
  • Joined: 18-September 12

Posted 16 February 2013 - 08:09 AM

View Postclapas, on 16 February 2013 - 06:50 AM, said:

That code is calling the update() method from yiiListView jQuery plugin whenever any element with class categoryFilter changes (f.e. select inputs).

The serialize() jQuery method takes all data from those inputs and converts them to an encoded query string, suitable for sending the data with an HTTP request.

As for the parameters in the update() call, ajaxListView is the ID of the list view container; and the second is the options map, i.e. the AJAX request options (see jQuery.ajax API manual).

Hope it helps.



thanks clapas....
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users