Last active
April 22, 2019 23:58
-
-
Save AmrAbdeen/fa5f7deb9e5f7b41f45202887ca75fa8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** ###### 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" | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment