---
title: "[转]关于Spark List控件和Spark DataGrid控件的提示"
author: "AS3"
date: "2011-06-02T05:23:04Z"
tags: []
categories: ["Web前端"]
slug: "spark-list-spark-datagrid"
draft: false
lastmod: "2011-06-02T05:23:04Z"
id: 1067894
url: "https://as3.iteye.com/blog/1067894"
---

<http://bbs.9ria.com/viewthread.php?tid=84874&extra=page%3D1%26amp%3Borderby%3Ddateline%26amp%3Bfilter%3D2592000>

在Halo DataGrid控件和Halo List控件中，你需要使用scrollToIndex(index:int)属性描写使得在那个index中的item可见。但是在Spark List控件和Spark DataGrid控件中，你需要使用不同属性，如下：

对于Spark List
ensureIndexIsVisible(index:int);

对于 Spark DataGrid (version 4.5) 
ensureCellIsVisible(index:int); 
setSelectedIndex(index:int);

希望你能喜欢以上提示