我们可以根据其值隐藏ng-grid中的某些行吗?(Can we hide certain rows in ng-grid based on its values?)
我有一系列的价值观。
Questions = [ {Name:"First", Status:"Valid"}, {Name:"Second", Status:"Invalid"}, {Name:"Third", Status:"Valid"}, {Name:"Fourth", Status:"Invalid"} ];
我可以在ng-grid中显示它们。 但是如果Status的值为Invalid,我可以隐藏一行吗?
I have an array of values.
Questions = [ {Name:"First", Status:"Valid"}, {Name:"Second", Status:"Invalid"}, {Name:"Third", Status:"Valid"}, {Name:"Fourth", Status:"Invalid"} ];
I can display these in the ng-grid. But can I hide a row if the value of Status is Invalid.
原文:https://stackoverflow.com/questions/25549877
更新时间:2023-04-30 10:04
最满意答案
FormFactory
类的CreateNamed方法分别使用FormType
和FormType
名称。编辑:
实际上名称与
FormType
无关。 它可以是任意任意名称。增加了服务声明。
<service id="loc_article.form" factory-method="createNamed" factory-service="form.factory" class="Symfony\Component\Form\Form"> <argument>los_article_form</argument> <argument>los_article_form_name</argument> <argument /> </service> <service id="loc_article.form.type" class="LOC\ArticleBundle\Form\Type\ArticleFormType"> <tag name="form.type" alias="los_article_form" /> <argument>LOC\ArticleBundle\Entity\Article</argument> </service>
CreateNamed method of
FormFactory
class takesFormType
and name of theFormType
respectively.Edit:
Actually name is not related to
FormType
. It can be any arbitrary name.Added service declaration.
<service id="loc_article.form" factory-method="createNamed" factory-service="form.factory" class="Symfony\Component\Form\Form"> <argument>los_article_form</argument> <argument>los_article_form_name</argument> <argument /> </service> <service id="loc_article.form.type" class="LOC\ArticleBundle\Form\Type\ArticleFormType"> <tag name="form.type" alias="los_article_form" /> <argument>LOC\ArticleBundle\Entity\Article</argument> </service>
相关问答
更多-
http://php.net/manual/en/language.namespaces.php 如果其名称未满,则类/接口名称将以当前名称空间名称作为前缀。 设置FormFactoryInterface全名或将其添加到use语句中 use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormFa ...
-
FormFactory类的CreateNamed方法分别使用FormType和FormType名称。 编辑: 实际上名称与FormType无关。 它可以是任意任意名称。 增加了服务声明。
los_article_form 我建议您在实体的存储库中创建自己的查询方法,例如,如下所示: class BoardRepository extends EntityRepository { public function findByCategory($category) { $builder = $this->createQueryBuilder('p'); $builder ->where($builder->expr()->like('p.postCateg ...createBuilder方法的第一个参数应该是表示表单类型的字符串。 ->createBuilder('form', object(Comment), array()) http://api.symfony.com/3.1/Symfony/Component/Form/FormFactory.html#method_createBuilder Ok, I fixe it, on route.php line 23 : $commentForm = $app['form.factory']->create ...Symfony2表格选项决议(Symfony2 Form Option Resolution)[2022-01-21]
我认为这只是调用错误服务的问题。 您通过以下方式获取了FormFactory的实例: $formFactory = $this->get('fos_user.registration.form.factory'); 但这不是Symfony的FormFactory 。 事实上,如果你在这里查看它的来源,你会看到: public function createForm() { return $this->formFactory->createNamed($this->name, $this->type ...Symfony2 Forms - 如何在表单构建器中使用参数化构造函数(Symfony2 Forms - How to use parametrized constructors in form builders)[2022-08-14]
找到了解决方案: 查看控制器“createForm()”方法的API,我发现了一些从示例中看不出来的东西。 似乎第二个参数不一定是一个对象: **Parameters** string|FormTypeInterface $type The built type of the form mixed $data The initial data for the form array ...你需要一个定制的属性编辑器。 您需要有一个扩展PropertyEditorSupport的类,例如RestaurantPropertyEditor extends PropertyEditorSupport ,它负责将餐馆或任何字段转换为文本表示。 它需要覆盖setAsText和getAsText 。 然后在您的控制器中返回视图,您将需要 @InitBinder("reservationLockRequestForm ") public void initBinder(WebDataBinder binde ...看来这是PHP 5.3.9的一个问题,我降级到5.3.6,现在一切都按预期运行 Seemed that it was a problem with PHP 5.3.9, I downgraded to 5.3.6 and everything is now running as expected从文档 : 要包装一个类,你必须将一个play.data.FormFactory注入到Controller中 Play已经知道FormFactory ,所以只需为它添加一个构造函数参数: public class FooController { private final FormFactory formFactory; @Inject public FooController(final FormFactory formFactory) { this.formF ...好吧,毕竟我不知道我是如何混淆的,但在重新安装symfony 2.6之前清除作曲家缓存确实解决了它。 Well, after all I don't know how I got things mixed up, but clearing composer cache before reinstalling symfony 2.6 did fix it.相关文章
更多- ext grid
- Java-based 实现的索引复制
- extjs4 editor grid 问题
- Ext 禁用grid
- Ext grid分页的问题
- 怎样改变 Ext grid 的字体大小
- Ext grid 出现checkbox和图标移位的问题(在IE)
- flume-ng+Kafka+Storm+HDFS 实时系统搭建
- java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter的解决方案
- Ext的例子 中有关grid渲染数据的问题
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)