Flex 取得DataGrid当前鼠标focus的itemindex

Flex4 DataGrid表格操作 Flex4 DataGrid表格操作,表格回车事件默认是换行,这里修改为换单元格,单元格轮完换行。支持上下左右和回车键控制光标位置,还添加了"+","-"按钮,用于控制添加行和删除选中的行。 立即下载
导读:
  DataGrid只有selectedIndex属性,却没有类似focusIndex的属性(至少到目前我没找到)
  所以只有自己编个函数:
  private function getDGFocusIndex(dg:DataGrid):Number {
  var findex:Number = Math.floor(dg.contentMouseY / dg.rowHeight) - 1 + dg.verticalScrollPosition;
  if (findex<0 || findex>=dg.verticalScrollPosition+dg.rowCount-1) {
  return -1;
  } else {
  return findex;
  }
  }
  

本文转自
http://zergling9999.spaces.live.com/blog/cns!2dc9465b4884c1f4!126.entry
focus使用教程 focus地震资料处理软件 处理地震数据 功能十分丰富 立即下载

相关推荐

MATLAB/Simulink实战:三电平逆变器SVPWM调制从入门到精通(附完整仿真模型)

本文提供了一份详尽的MATLAB/Simulink实战指南,手把手教你从零搭建三电平逆变器的SVPWM调制系统。文章深入剖析了27个空间矢量的分区与分解算法,并完整实现了包含中点电位平衡控制的Simulink仿真模型,旨在帮助电力电子与电机控制领域的学习者和工程师跨越从理论到实践的鸿沟。

sugar的博客 1213

g6学习笔记三(Graph)

Graph 是 G6 图表的载体,有的 G6 节点实例操作以及事件,行为监听都在 Graph 实例上进行。Graph 的初始化通过 new 进行实例化,实例化时需要传入需要的参数。

vue6214的博客 6002

保姆级教学,教你在vscode和cursor上调试matlab!!!

保姆级教你如何在vscode或者cursor上面调试matlab

yang_upup的博客 2083

Qt图形视图框架

Qt图形视图框架图形视图体系结构 图形视图体系结构 Graphics View框架结构”三元素“:场景类(QGraphicsScene)、视图类(QGraphicsView)和图元类(QGraphicsItem)。场景类提供管理位于其中的图元容器,视图类显示场景中的图元,场景可以通过多个视图表现。 QGraphicsScene QGraphicsView QGraphicsItem 直线(QGraphicsLineItem)、椭圆(QGraphicsEllipseItem)、文本图元(QGraphics

yxqq378287007的博客 1719

伺服电机三环控制实战:从参数整定到系统优化

本文以实战视角,深入解析伺服电机三环控制(位置环、速度环、电流环)的参数整定与系统优化全流程。文章摒弃复杂理论,通过生动的比喻和分步调试指南,详细阐述了从电流环快速响应、速度环平滑调节到位置环精准定位的调试方法,并提供了常见问题排查与进阶优化技巧,帮助工程师有效提升伺服系统性能与稳定性。

weixin_29201933的博客 244

Ubuntu 20.04 LTS下5分钟搞定ONLYOFFICE协作空间社区版(Docker版保姆级教程)

本文提供了一份在Ubuntu 20.04 LTS系统上,通过Docker快速部署ONLYOFFICE协作空间社区版的保姆级教程。内容涵盖从系统准备、Docker环境搭建,到执行自动化安装脚本、完成Web初始化的全流程,并详细说明了部署后的安全配置、数据备份及基本运维要点,帮助用户高效构建私有、安全、可控的团队文档协作平台。

weixin_28826961的博客 261

QT(13):QGraphicsScene

如果场景失去焦点(即有人调用clearFocus()),而item具有焦点,则场景将保留其item焦点信息,一旦场景恢复焦点,它将确保最后一个焦点item重新获得焦点。有两个选择:通过调用addItem()来添加现有的QGraphicsItem对象,或者可以调用更方便的函数addEllipse(),addLine(),addPath(),addPixmap(),addPolygon(),addRect(),或addText()之一,这些函数都返回指向新添加项的指针。场景矩形定义场景的范围。

qq_45088122的博客 1070

EMC辐射整改常用的4种整改方法

例如,产品设计研发工程师们根据需求,设计出效果良好的滤波电路,置入产品I/O(输入/输出)接口的前级,可使因传导而进入系统的干扰噪声消除在电路系统的入口处;通过选择元器件和合理安排的电路系统,使干扰的影响减少。有些频率点是通过电路板上走线分布参数所决定的,通过前述方法不大有用,此类整改通过在走线中增加小的电感、电容、磁珠来改变电路参数结构,使其移到限值要求较高的频率点上。电线电缆的分类整理在电子设备中,线间耦合是一种重要的途径,也是造成干扰的重要原因,因为频率的因素,可大体分为高频耦合与低频耦合。

学海无涯的专栏 3124

qml中activeFocusItem用法

问题: 今天在qml程序里调试时,打印Window.activeFocusItem 的值,经常为null, 后来打印activeFocusItem 时不为空。 具体Window.activeFocusItem 和activeFocusItem的区别,qt帮助文档里也没详细说明。

qq_43248127的博客 855

YOLOv11改进 | Neck篇 | 双向特征金字塔网络BiFPN助力YOLOv11有效涨点

本文给大家带来的改进机制是BiFPN双向特征金字塔网络,其是一种特征融合层的结构,也就是我们本文改进YOLOv11模型中的Neck部分,它的主要思想是通过多层级的特征金字塔和双向信息传递来提高精度。本文给大家带来的结构可以让大家自行调节网络结构大小,同时能够达到一定的轻量化效果,为什么发BiFPN呢因为它算是YOLO系列改进中的常青树了,大家可以借鉴它的双向特征思想来创新自己的Neck结构本文的BiFPN通过yaml文件配置可以让大家自行调配其结构。

Snu77的博客 9102

YOLO26涨点改进 | 全网独家创新、检测头Head改进篇 | AAAI 2026 | 使用StripConvHead改进YOLO26的检测头,处理小目标、遮挡小目标检测有效涨点,助力高效发论文

🔥本文给大家介绍使用StripConv条形卷积改进 YOLO26的检测头,可以显著提高模型在高纵横比物体检测、目标定位和多尺度物体检测方面的表现。StripConv条形卷积能够更有效地捕捉细长物体的特征,提升定位精度,并通过简化卷积核设计减少计算冗余,优化计算效率。此外,该改进增强了 YOLO26对复杂场景和实时任务的适应能力,特别适用于遥感图像目标检测、小目标检测等领域。具体怎么使用请看全文。摘要:随着遥感物体检测的快速发展,检测高纵横比物体仍然是一个挑战性问题。

Ai缝合怪、助力小伙伴高效发论文 268

react中键盘事件无法在div上触发的问题解决

通常情况下在div上是无法聚焦触发键盘事件 <div id="HelloWorld01" onKeyUp={event => { console.log(event, event.keyCode, "event"); }} > <Card bodyStyle={{ paddingTop: 14 }}> <ContractView {...detail} /> </Card> <

weixin_44953227的博客 1万+

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

AntV-G6 记录折叠节点,数据更后节点保持之前的折叠状态

首先,在进行折叠操作的时候就用数组记录下被折叠的节点,因为setState函数只要改变了状态(节点展开和折叠)就会执行,所以在数据更新后渲染历史节点状态时也会执行,要注意 不要重复push setState(name, value, item) { let flag = false; // 用来判断是否是历史数据用来初始化的,如果是历史数据就不push进数组 if (name === 'collapsed') { if (value === true) {

Blablabla_的博客 4220

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

Flex中如何利用focusIn和focusOut事件对表单中获得焦点的项目进行颜色高亮(highlight)显示的例子

本文转载自: 接下来的例子演示了Flex中如何利用focusIn和focusOut事件,对表单中获得焦点的项目进行颜色高亮(highlight)显示。

xjh1991xjh的专栏 1498

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

js中遇到FocusItem is not defined at HTMLInputElement.onfocus解决办法(jsp中)

错误提示:函数未定义,如果真的忘记定义函数那就快回去定义函数吧,浏览器没有冤枉你。 但如果已经定义过函数那你可以检查一下你的函数是这样定义的吗? 在jsp文件中直接定义成这样函数的作用域局限于script标签之中所以我们需要将函数定义改成下面这样。 ...

Kyrie6c的博客 2200

flex datagrid itemrender 渲染 问题及解决办法

项目中遇到这样一个问题: 在datagrid中加itemrender,itemrender中是个checkbox,checkbox根据当前行的数据决定是否选中它, 当设置datagrid的高度不能完全显示列表中数据时,滚动列表时checkbox有时选中有时不选中,且有时会选到其它行上:问题分析:假设您要显示 1,000 条记录。如果您认为列表控制会创建 1,000 个 itemRenderer, 您就错了。如果列表只显示 10 行, 它会创建约 12 个 itemRenderer-这些足以显示各个可见行,

ChinFeng的专栏 4532

如何在Flex3中获取鼠标经过DataGrid时所在的行列索引

1.在目标dagagrid中添加mouseover监听函数。 2.在as脚本中添加相应函数。 protected function datagrid1_mouseOverHandler(event:MouseEvent):void { if(event.target is DataGridItemRenderer) { //项呈现器 var itemRendere

细节决定成败 1865

【G6】G6学习笔记(二)

前言 再次稍微研究了下这玩意,这玩意难用的地方在于,第一、文档写的很混乱,有很多漏写的。 第二、报错经常是它内部报错,得看它里面到底咋回事才知道为啥出现错误。第三、卸载比较诡异,如果有路由相互切换的话,可能得踩点坑。 事件 首先事件方面,可以通过graph.on监听事件,可以监听这些: // click?: string; // mousedown?: string; // mouseup?: string; // dblclick?: string;

不忘初心,坚定道路! 5912

Flex中DataGrid获取被选中的行

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.a

JavaMan 8336

Flex小功能——取得DataGrid中鼠标所在的行数

没事看浪曦视频的时候,发现这个小功能挺有意思.....      var findex:Number = Math.floor(dg.contentMouseY/dg.rowHeight)-1 + dg.verticalScrollPosition;     //dg.contentMouseY是鼠标所在的local坐标系相对于datagrid的高度     //dg.rowHeigh...

fhuan123的专栏 161
上一篇: ubuntu7.10下使用QQ聊天-wine+QQ2007安装设置方法
下一篇: 分布式的Flex开发
microrain
博客等级 码龄25年 1128粉丝 194原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值