Extensions Wiki » Extensions » Refresh Livetable With Changed URL

Refresh Livetable With Changed URL

Last modified by Vincent Massol on 2013/03/11 09:38
tableHelp you update the livetable URL and refresh the content when the user chooses a different option from a HTML select element
TypeSnippet
Developed by

Oana Tabaranu

LicenseGNU Lesser General Public License 2.1

Table of contents

Description

<select  id="document-options">
 <option value="selectValue1">select option 1</option>
 <option value="selectValue2">select option 2</option>
 <option value="selectValue3">select option 3</option>
</select>
document.observe('dom:loaded', function() {
   if($('document-options')) {
      Event.observe($('document-options'), 'click', function() {
       var selectedParameter = $('document-options').value;
       // change paramName parameter value in the livetable URL and refresh
       var index = ta.getUrl.indexOf('paramName=');
       if(index > 0) {
          ta.getUrl = ta.getUrl.substr(0, index - 1) + "&paramName=" + selectedParameter;
        }
       // refresh live table
       ta.clearCache();
        ta.showRows(1, ta.limit);
      });
    }
  });
Created by Oana Tabaranu on 2010/04/09 17:11

Download XWiki

My Recent Modifications

Get Connected