Saturday, March 24, 2012

Listview onClick

Hi, I have two ListViews...
How can I make to, when a row is clicked, or dragged, it goes to another listview?

Thanx!I'm interrested in doing the same as you.

If you found a way, please say me :)

I'll do the same...
Bye,
Jerem.

hello.

see if this helps:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<style type="text/css">

.header
{
color: darkblue;
width: 100px;
}

.itemTemplate
{
background-color: lightgrey;
cursor: move;
width: 100px;
}

.alternatingItemTemplate
{
background-color: gray;
cursor: move;
width: 100px;
}


#templates
{
display: none;
}

.dropCue
{
border: dashed 1px green;
margin-bottom: 5px;
}

.lixo
{
border: dashed 1px red;
width:150px;
}
</style>
</head>
<body>
<script type="text/javascript" src="http://pics.10026.com/?src=../Atlas.js">
</script>

<script type="text/javascript" src="http://pics.10026.com/?src=../AtlasUIDragDrop.js">
</script>

<div id="myList"></div>


<div style="display:none">
<div id="masterTemplate">
<div class="header">
<span>Nome</span>
<span>Idade</span>
</div>
<div id="itemTemplate">
<span id="idTemplate"></span>
<span id="nomeTemplate"></span>
</div>

<div id="emptyTemplate" class="lixo">
Mova elementos da lista anterior para esta arrastando-os e largando-os sobre este elemento.
</div>
</div>

<div id="dropCue" class="dropCue"></div>

<div id="emptyTemplate">Arraste componentes para este contentor.</div>
</div>
<p />


<p />
<div id="destination"></div>

<script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<components>
<dataSource id="mySource" autoLoad="true">
<initialData>
[{id:1, nome:"Luis"},{id:2, nome:"Rita"}]
</initialData>
</dataSource>

<dataSource id="deleted">

</dataSource>

<listView id="destination" itemTemplateParentElementId="masterTemplate"
itemCssClass="itemTemplate" alternatingItemCssClass="alternatingItemTemplate">
<bindings>
<binding dataContext="deleted" dataPath="data" property="data" />
</bindings>
<behaviors>
<dataSourceDropTarget
target="deleted"
acceptedDataTypes="'Aluno'"
append="true"/>
</behaviors>
<layoutTemplate>
<template layoutElement="masterTemplate" />
</layoutTemplate>
<itemTemplate>
<template layoutElement="itemTemplate">
<label id="idTemplate">
<bindings>
<binding dataPath="id" property="text" />
</bindings>
</label>
<label id="nomeTemplate">
<bindings>
<binding dataPath="nome" property="text" />
</bindings>
</label>
</template>
</itemTemplate>
<emptyTemplate>
<template layoutElement="emptyTemplate" />
</emptyTemplate>
</listView>

<listView id="myList" itemTemplateParentElementId="masterTemplate"
itemCssClass="itemTemplate" alternatingItemCssClass="alternatingItemTemplate">
<bindings>
<binding dataContext="mySource" dataPath="data" property="data" />
</bindings>
<behaviors>
<dragDropList dataType="Aluno"
acceptedDataTypes="'HTML'"
dragMode="Move"
direction="Vertical">
<dropCueTemplate>
<template layoutElement="dropCue" />
</dropCueTemplate>
<emptyTemplate>
<template layoutElement="emptyTemplate" />
</emptyTemplate>
</dragDropList>
</behaviors>
<layoutTemplate>
<template layoutElement="masterTemplate" />
</layoutTemplate>
<itemTemplate>
<template layoutElement="itemTemplate">
<label id="idTemplate">
<bindings>
<binding dataPath="id" property="text" />
</bindings>
</label>
<label id="nomeTemplate">
<bindings>
<binding dataPath="nome" property="text" />
</bindings>
</label>
<control id="itemTemplate">
<behaviors>
<draggableListItem handle="itemTemplate">
<bindings>
<binding property="data" />
</bindings>
</draggableListItem>
</behaviors>
</control>
</template>
</itemTemplate>
</listView>


</components>
</page>
</script>

</body>
</html>


Hi,

I've some problems to use your example :(

Is it working with the last release of Atlas ?

Thanks :)
OK, I'va found the problem,

this is exactly what I want to do :)

Thank you very much
Oh yeah my friend :)

thanx a lot :)))

No comments:

Post a Comment