简体   繁体   English

SharePoint | 网页部分| 如何根据状态限制下拉菜单选项

[英]SharePoint | Web-Part | How to Limit Dropdown Options Based on the Status

I'm wondering how to achieve this via custom web part and JavaScript 我想知道如何通过自定义Web部件和JavaScript实现此目标

I'm looking for a way on how to limit the dropdown status based on its current state. 我正在寻找一种基于其当前状态来限制下拉菜单状态的方法。 For example I have status: Start, On-Going, Completed and Pending 例如,我的状态为:开始,进行中,已完成和待处理

the initial status of Start must only have On-Going as its option. “开始”的初始状态只能选择“进行中”。

jQuery - $('#idofyourdropdown option[value="On-Going"]''); jQuery- $('#idofyourdropdown option[value="On-Going"]''); OR 要么

$('#idofyourdropdown option:contains("On-Going")');

OR using index asssuming On-Going is hte first option 或使用索引假设“持续进行”是首选

$('#idofyourdropdown option:eq(1)').prop('selected', true);

OR even this 甚至这个

$('#idofyourdropdown').val('On-Going');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何删除所有出现的相同 Web 部件列表的标题 - How to remove headers on all occurrences of the same Web-part list 无法使用 React APP WEB 部分从网站内容的特定列表项中获取数据 - Not able to fetch data from particular list item of site content using React APP WEB-part 如何限制下拉菜单上显示的选项数量? - How can I limit the number of options that show on my dropdown menu? 如何基于另一个下拉选择动态填充的下拉列表中选择? - How to dynamically populate options on dropdown lists based on selection in another dropdown? 如何在SharePoint Online中为内容搜索Web部件创建排序/筛选? - How to create Sorting/filtering for Content Search Web Part in SharePoint Online? 如何将简单的jquery滑块添加到Sharepoint 2010 Web部件 - How to I add a simple jquery slider to a Sharepoint 2010 web part 如何在共享点Web部件中添加内联JS / HTML代码 - How to add a inline JS/HTML code in a sharepoint web part Sharepoint 2010:如何动态更改Web部件中列表的视图 - Sharepoint 2010: How to dynamically change the view of a list in a web part 如何从 SharePoint Web 部件访问 onresize 事件? - How do I access the onresize event from a SharePoint Web Part? 如何限制一个选项 <select>根据另一个选项选择 - How to limit options in a <select> based on another option selection
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM