javascript $ v(),$ s(),$ x(),apex.item,JQ

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript $ v(),$ s(),$ x(),apex.item,JQ相关的知识,希望对你有一定的参考价值。

/** ###### PLEASE TAKE ATTENTION ###### //
  * (( $v(), $s(), $x(), apex.item )) are APEX API "SHOULD BE" using them instead of JQ, Just i added some JQ here as more info for you - in some cases the JQ returns some diff results so the API is better to use it always .. Take care..
---------------------------------------------------------------------------- */

// Getting Item Value
$v("P2_ENAME");  /* it's same same */  apex.item( "P2_ENAME" ).getValue(); /* it's same same */ $("#P2_ENAME").val();

// Set Item with Value
$s("P2_ENAME",'AMR');  /* it's same same */ apex.item( "P2_ENAME" ).setValue('AMR'); /* it's same same */ $("#P2_ENAME").val('AMR');

//Getting the itme as HTML code if existing otherwise will return false.
$x("P2_ENAME"); // return string | Boolean
/* 
->
<select id="P2_NAME" name="P2_NAME" class="selectlist apex-item-select" size="1"><option value="" selected="selected"></option>
<option value="Return1">Display1</option>
<option value="Return2">Display2</option>
</select>
*/

// Getting the display value of LOV
apex.item( "P2_ENAME" ).displayValueFor(10); //10 = is the return LOV value, Make sure it's case sensitive with String Value, Take Care.

// Hide/Show item
apex.item( "P2_NAME" ).hide(); /* it's same same */ $( "#P2_NAME" ).hide();
apex.item( "P2_NAME" ).show(); /* it's same same */ $( "#P2_NAME" ).show();

// Enable/Disable Item
apex.item( "P2_NAME" ).enable(); /* it's same same */ $( "#P2_NAME" ).prop('disabled', false);
apex.item( "P2_NAME" ).disable(); /* it's same same */ $( "#P2_NAME" ).prop('disabled', true);

// Check if any item is changed or not since rendred
apex.item( "P2_NAME" ).isChanged(); // return boolean.

// If you would to set some CSS style on it so ..
apex.item( "P2_NAME" ).setStyle({
  //Add some CSS here ...
  "font-size":"20px",
  "color":"red"
});

以上是关于javascript $ v(),$ s(),$ x(),apex.item,JQ的主要内容,如果未能解决你的问题,请参考以下文章

JavaScript中的setInterval用法

JavaScript颜色选择器

异步加载JSCSS

javascript消除字符串两边空格的两种方式,面向对象和函数式编程

Vue2.0内部指令(中)|言Sir‘s blog

javascript中使用正则表达式