Announcement

Collapse
No announcement yet.

Grid js methods

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Grid js methods

    Hi, why isn't available programming - js methods in grid? Please consider adding this programming option.

  • #2
    Hello,

    I will discuss your suggestion with our team.

    regards,
    Bernhard

    Comment


    • #3
      Are this suggestions tracked? Over a month has passed and still nothing

      Comment


      • #4
        This option is very useful and important. At the moment I already integrated some jQuery scripts and functions in "onscriptinit" and "onapplicationinit", but does not work properly ... I repeat this option is very useful and important. For me, the lack of this option is a very big impediment in the projects that I have. I look forward to an upgrade. It would be great if you can create an option to insert custom javascript code in head section. And last but not least ... scriptcase is great! Thank you.
        Last edited by angelrobv; 04-12-2014, 05:43 PM.

        Comment


        • #5
          I played a bit and found a solution that works without errors at first look.
          Is a solution only if you urgently need to include java script or jquery.
          We expect an update that contains this module.
          The script is:


          // Caution !!! This script will modify the js file of your grid application
          // It will check if is modified and if not will insert your custom script
          // Caution !!! This is working only when: "Use Ajax" is checked "YES" in Settings
          // Caution !!! If you need or want to use quotes " inside JQUERY or FUNCTION script,
          // put an backslash before quotes like in this example alert(\"text\");
          // or use simple quotes without backslash like in this example alert('text');
          // Put this script in "onApplicationInit" in your grid application
          // Write your script only between START and END

          // *** HERE *** Write the application name ex. grid_example
          // ************************************************** ****************
          $app_nm = "grid_example";
          // ************************************************** ****************



          $wrt_js = "<script>\n
          $(document).ready(function(){
          custom_script();
          });
          function custom_script () {
          // ************************************************** ************
          // ***************** START EDIT JQUERY CUSTOM SCRIPT *****************

          // Example for: <p class='.abc'> TEST </p> This will show an alert with content of 'p' with class: 'abc'
          $('.abc').click(function() {
          alert ( $(this).html() );
          });


          // **************** END EDIT JQUERY CUSTOM SCRIPT **********************
          // ************************************************** **************

          }

          //************************************************** ************************
          // **************** START EDIT JAVASCRIPT FUNCTION CUSTOM SCRIPT ****************

          // Call this function in html using ex. <p onclick='alert_click(\"Somethig...\")' > TEST </p>
          function alert_click (msg){
          alert (msg);
          }


          // **************** END EDIT JAVASCRIPT FUNCTION CUSTOM SCRIPT ******************
          // ************************************************** ***********************
          </script>\n
          ";


          // *** Do not modify this ***
          $app_nm_js = $app_nm."_jquery.js";
          $file = fopen($app_nm_js,"r");
          $content = fread($file,filesize($app_nm_js));
          $index = strpos($content, 'custom_script');
          fclose($file);
          if(!$index) {
          $file = fopen($app_nm_js,"w");
          $content = str_replace("scAjaxProcOff","scAjaxProcOff();\n custom_script", $content);
          //fwrite($file, $content);
          $wrt_js .= $content;
          $wrt_js = str_replace("<script>"," ", $wrt_js);
          $wrt_js = str_replace("</script>"," ", $wrt_js);
          file_put_contents($app_nm_js, $wrt_js);
          fclose($file);
          }
          Last edited by angelrobv; 04-15-2014, 08:05 AM.

          Comment


          • #6
            A nice workaround but still we need an update with the js module available

            Comment


            • #7
              So Scriptcase8 Launched but.... a js module missing. Hmmmm

              Comment


              • #8
                Very important feature
                Last edited by magezi; 09-12-2016, 10:32 AM.

                Comment

                Working...
                X