首页
\
问答
\
Flex 4.5.1在新应用程序上添加一个简单的Bitmap或Sprite?(Flex 4.5.1 Add a simple Bitmap or Sprite on new application?)
Flex 4.5.1在新应用程序上添加一个简单的Bitmap或Sprite?(Flex 4.5.1 Add a simple Bitmap or Sprite on new application?)
也许这是一个坏习惯,我自从Flash Professional以来仍然有,但我试图添加一个简单的Sprite或/和我刚创建的Bitmap到一个空的应用程序,它没有发生。
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="application1_creationCompleteHandler(event)"> <fx:Script> <![CDATA[ import mx.core.FlexGlobals; import mx.core.UIComponent; import mx.events.FlexEvent; protected function application1_creationCompleteHandler( event : FlexEvent ) : void { var s:Sprite = new Sprite(); s.graphics.beginFill( 0xFF0000, 0.5 ); s.graphics.drawRect( 0, 0, 100, 100 ); s.graphics.endFill(); this.addChild( s ); } ]]> </fx:Script> </s:Application>
有人能告诉我我做错了什么并帮我纠正吗?
Maybe it is a bad habit which I still have since Flash Professional, but I'm trying to add a simple Sprite or/and Bitmap I just created to an empty Application and it's not happening.
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="application1_creationCompleteHandler(event)"> <fx:Script> <![CDATA[ import mx.core.FlexGlobals; import mx.core.UIComponent; import mx.events.FlexEvent; protected function application1_creationCompleteHandler( event : FlexEvent ) : void { var s:Sprite = new Sprite(); s.graphics.beginFill( 0xFF0000, 0.5 ); s.graphics.drawRect( 0, 0, 100, 100 ); s.graphics.endFill(); this.addChild( s ); } ]]> </fx:Script> </s:Application>
Could someone tell me what I am doing wrong and help me correct it?
原文:https://stackoverflow.com/questions/6493564
更新时间:2023-10-24 09:10
最满意答案
升级到1.10.12(数据表)解决了这个问题。
//cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js
我还必须将过滤器更新为自定义过滤器,而不是像我在我的问题中那样内联。
//Initial Value $scope.filterTag = "TYPE 1"; $scope.dtInstance = {}; $scope.filteredData = $scope.items.filter(function(r) { var tag = (typeof $scope.filterTag === undefined)? "TYPE 1" : $scope.filterTag; var show = r.TagName == tag; return show; }); var update = function(){ $scope.filteredData = $scope.items.filter(function(r) { var tag = (typeof $scope.filterTag === undefined)? "TYPE 1" : $scope.filterTag; var show = r.TagName == tag; return show; }); }
工作示例
An upgrade to 1.10.12 (datatables) fixed the issue.
//cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js
I also had to update the filter to be a custom filter instead of inline as I had in my question.
//Initial Value $scope.filterTag = "TYPE 1"; $scope.dtInstance = {}; $scope.filteredData = $scope.items.filter(function(r) { var tag = (typeof $scope.filterTag === undefined)? "TYPE 1" : $scope.filterTag; var show = r.TagName == tag; return show; }); var update = function(){ $scope.filteredData = $scope.items.filter(function(r) { var tag = (typeof $scope.filterTag === undefined)? "TYPE 1" : $scope.filterTag; var show = r.TagName == tag; return show; }); }
Working example
相关问答
更多-
有几种不同的方法可以达到你想要的效果。 考虑到你的设置,我认为最简单的方法是创建一个特殊的orderType ,它返回一个值,该值基于呈现元素的orderType fa-*类: $.fn.dataTable.ext.order['fa-classes'] = function(settings, col) { return this.api().column( col, {order:'index'} ).nodes().map(function(td, i) { return $('i ...
-
在将数据放入DataTable之前将数据舍入: round(ColumnB, digits=2) Round the data before you put it into DataTables: round(ColumnB, digits=2)
-
升级到1.10.12(数据表)解决了这个问题。 //cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js 我还必须将过滤器更新为自定义过滤器,而不是像我在我的问题中那样内联。 //Initial Value $scope.filterTag = "TYPE 1"; $scope.dtInstance = {}; $scope.filteredData = $scope.items.filter(function(r) { var t ...
-
我相信gridData是你从角度smartTables或角度UI网格中获取的东西? 另外, fromSource()意味着一个AJAX源 - 通常是像data.json这样的文件,远程或本地。 以下是实现您想要的步骤: 标记:
脚本: $scope.dtColumns = [ DTColumnBuilder.newColumn('id', 'ID'), ...
-
您可以使用列呈现功能。 当dataTables需要count列的值,并希望使用该值sort列进行sort ,则传回包含列数据的数字部分的类型化数字: $scope.dtColumnDefs = [ DTColumnDefBuilder .newColumnDef(2) .withOption('type', 'number') .renderWith(function(data, type, full) { if (type == 'sort') { ...
-
数据表和使用过滤器(Datatables and Using Filters)[2023-04-26]
解 您可以使用ajax.data选项添加要发送到服务器的其他参数,这将是您的组ID。 $('#example').DataTable({ "ajax": { "url": "/test/0", "data": function(d){ d.form_group = $('#example-group').val(); } } }); // Handle filter change event $ ... -
我解决了这个问题。 angular-datatables已经提供了一个指令。 要告诉Angular在范围内呈现表格,您必须将元素