Home
ProductsCustomers
About usContact
Purchase
Animated zoom toolbar
Horizontal and vertical split
Listview
Treeview
Window manager

Adding items using AJAX

To add multiple items using AJAX and serverside programming, call the function:

Listview.AddItemsFromAJAX(string url, string[][] formPostArguments)

The first argument is the URL that is requested by the AJAX object, i.e:

'MyListviewData.aspx?userId=1001'

The second argument is an array of form post arguments, which is formatted like this:

[['ID', '19994'],['CODE', 'ABCD']]

Pass null, if no form post arguments are needed.

Server side AJAX code

The document the listview reads must be specially formated.

The page should be entirely blank, without any tags or doctype specified.

Each listview item is bound around a <B> tag.

Within this tag, every subitem is added as an <U> tag:

Content of server side document:

<b><u>Ajax.htm</u><u>1 KB</u><u>2009-10-15 14:21</u></b>
<b><u>Is.php</u><u>2 KB</u><u>2009-10-16 12:32</u></b>
<b><u>Cool.aspx</u><u>3 KB</u><u>2009-10-17 09:13</u></b>

This is the most basic form. To add more arguments to each item, they should be added as properties to the <B> tag: 

<b Icon16="images/file.png">

In the above example, the Icon16 property is set.

The following properties can be passed with each list item:

  • Icon16
  • Icon32
  • Icon48
  • Icon64
  • Icon96
  • Icon128
  • UID

Note: The UID is the unique identifier for the list item.

Including column headers in the AJAX result

If your result is dynamic, you can include column headers with your result, ensuring the listview is presented correctly regardsless of the result.

At the top of the server document, simply add <I> tags for each column header that is needed, i.e.:

<I width="200">Filename</I>
<I width="130">Size</I>
<I width="110">Date</I>

The width property must always be set to an integer do define the width of each column header.

It is possible to add the following optional properties:

  • align
  • datatype

Align can be set to one of the following:

  • Left
  • Right
  • Center

Datetype can be set to one of the following:

  • Text
  • Numeric
  • Datetime

 

Copyright ® ID Web Controls - 2009 - 2010