我怎样才能得到未选择的选项的值在选择二用select2:unselect
$('#mySelect').on("select2:unselect", function(e){
var unselected_value = $('#mySelect').val(); // using this shows 'null'
// or using below expression also shows 'null'
var unselected_value = $('#mySelect :selected').val();
alert(unselected_value);
}).trigger('change');
Run Code Online (Sandbox Code Playgroud)
在上面的代码警报显示'null'
我需要使用,select2:unselect因为'change'事件会感觉到:select并且:unselect两者兼而有之.
我看到我的一些项目在NetBeans的"项目"窗口下有" 重要文件 "文件夹.并非所有项目都有这个.这不是磁盘上的物理文件夹,并且已在"Source Files"文件夹下列出已存在的文件.这是什么以及NetBeans如何填充此文件列表?我使用的是NetBeans 7.2版
我想为WooCommerce Mini Cart创建一个自定义小部件,但也想保留WC的默认Mini Cart小部件,因此我不希望通过将mini-cart.php复制到主题来覆盖模板。我刚刚从插件的小部件目录(plugins / woocommerce / includes / widgets / class-wc-widget-cart.php)中复制了小部件类,还通过复制默认的mini-cart.php代码为迷你购物车创建了新的模板文件在我主题目录下的文件中,例如custom-mini-cart.php,它只是核心文件的修改版本。现在,我想为我的窗口小部件加载该模板文件。如您所见,我正在使用的小部件类与核心小部件的类非常相似:
class WC_Dropdown_Cart extends WC_Widget {
public function __construct() {
$this->widget_cssclass = 'woocommerce widget_shopping_cart';
$this->widget_description = __( "Custom Mini Cart", 'woocommerce' );
$this->widget_name = __( 'Custom Mini Cart', 'woocommerce' );
$this->widget_id = 'woocommerce_widget_custom_mini_cart';
$this->settings = array(
'title' => array(
'type' => 'text',
'std' => __( 'Cart', 'woocommerce' ),
'label' => __( 'Title', 'woocommerce' )
),
'hide_if_empty' => array(
'type' => 'checkbox',
'std' => 0,
'label' => __( 'Hide if …Run Code Online (Sandbox Code Playgroud)