Learn how to create a RSSFeed reader with the jQuery plug-in EasyUIEasyUI

Source: Internet
Author: User
This article helps you easily learn the jQuery plug-in EasyUI. We will create an RSS reader through the jQueryEasyUI framework, if you are interested, you can refer to the example in this article to create an RSS reader through the jQuery EasyUI framework and share it with you for your reference. The details are as follows:
The running effect is as follows:

We will use the following plug-ins:
Layout:Create an application user interface.
Datagrid:Displays the RSS Feed list.
Tree:Displays the feed channel.
Step 1: Create a Layout (Layout)

 

jQuery EasyUI RSS Reader Demo

    Title Description Publish Date

    Step 2: Data Grid handles events

    Here we want to handle some user-triggered events.

    $('#dg').datagrid({ onSelect: function(index,row){ $('#cc').attr('src', row.link); }, onLoadSuccess:function(){ var rows = $(this).datagrid('getRows'); if (rows.length){  $(this).datagrid('selectRow',0); } }});

    In this example, the 'onselect' event is used to display the feed content, and the 'onloadsuccess' event is used to select the first line.
    Step 3: Process events using a Tree

    When the Tree data has been loaded, We need to select the first leaf node and call the 'select' method to select the node. Use the 'onselect' event to obtain the selected node, so that we can obtain the corresponding 'url' value. Finally, we call the 'load' method of the data grid to refresh the data in the feed list.

    $('#t-channels').tree({ onSelect: function(node){ var url = node.attributes.url; $('#dg').datagrid('load',{  url: url }); }, onLoadSuccess:function(node,data){ if (data.length){  var id = data[0].children[0].children[0].id;  var n = $(this).tree('find', id);  $(this).tree('select', n.target); } }});

    The above is a tutorial on how to create an RSS Feed reader on EasyUI. I hope it will be helpful to you.

    Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.