Results 1 to 4 of 4

Thread: Hiding Subpanels inSugarCE

  1. #1
    vijay9948 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    56

    Default Hiding Subpanels inSugarCE

    Hi every one,

    My requirement is (for custom module)
    i have a dropdown list for onchange event of dropdown list subpanels should be enabled.I have searched for this code and i got the below link
    http://developers.sugarcrm.com/tutor...Panels_5.1.pdf

    Whatever the code present in above link same code i put in custom/modules/<custom module name>/views/view.edit.php,view.detail.php


    but when am clicking on create<modulename> link
    it is showing php parse error (whatever the coding i have written everything is correct)

    how can i rectify this
    pls anyone tell me
    plsplspls

  2. #2
    daniel.passarini's Avatar
    daniel.passarini is offline Sugar Community Member
    Join Date
    Apr 2006
    Location
    São Paulo - SP / Brasil
    Posts
    80

    Default Re: Hiding Subpanels inSugarCE

    please, post the error message and the code you have written
    Daniel de Carvalho Passarini

    "Fascinating" - Dr. Spock

  3. #3
    letrium is offline Sugar Community Member
    Join Date
    Dec 2008
    Posts
    614

  4. #4
    vijay9948 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    56

    Default Re: Hiding Subpanels inSugarCE

    Quote Originally Posted by daniel.passarini View Post
    please, post the error message and the code you have written

    Thank U for ur reply,
    Here the code for my custm modulename(DirecrDeposit)
    (custom/modules/T698_DirectDeposit\views\view.edit.php)

    view.edit.php

    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    require_once('include/json_config.php');
    require_once('include/MVC/View/views/view.edit.php');
    class T698_DirectDepositViewEdit extends ViewEdit{
    function T698_DirectDepositViewEdit(){
    parent::ViewEdit();
    }
    function display(){
    global $app_list_strings;
    global $mod_strings;
    $fieldName='transcation_type';
    $dropDownName='transcation_type_list';
    $e=$this->ev->defs['panels'];
    $panelArray=array();
    foreach($e as $panel_label=>$panel_data ){
    if($panel_label!=''&&$panel_data!='default')
    {
    $tempArray=array($panel_label,$mod_strings[strtoupper($panel_label)]);
    array_push($panelArray,$tempArray);
    }
    }
    $prePop='document.getElementById(\''.$fieldName.'\ ').onchange();';
    print'<script>types= new Array();
    sysName= new Array();
    lblName=new Array();';
    foreach($app_list_strings[$dropDownName] as $val)
    {
    if($val!='')
    {
    print"types.push(\"$val\");";
    }
    }
    $h=0;
    foreach($panelArray as $val)
    {
    print"sysName['$h']=\"$val[0]\";";
    print"lblName['$h']=\"$val[1]\";";
    $h++;
    }
    print'var fieldName=\''.$fieldName.'\';';
    print'</script>';
    $js=<<<EOQ
    <script>
    document.getElementById(fieldName).onchange=functi on(){
    if(document.getElementByName(fieldName)[0].value)
    {
    var value=document.getElementByName(fieldName)[0].value;
    value=value.toUpperCase()+'INFO';
    }

    for(i=0;i<sysName.length;i++)
    {
    if(document.getElementById(sysName[i].toUpperCase()))
    {
    for(j=0;j<types.length;j++)
    {
    if(types[j].toUpperCase()+'INFO'==lblName[i])
    {
    document.getElementById(sysName[i].toUpperCase()).style.display="none";
    }
    }
    }
    }
    for(i=0;i<lblName.length;i++)
    {
    if(value==lblName[i])
    {
    document.getElementById(sysName[i].toUpperCase()).style.display="block";
    }

    }
    };
    $prePop;
    </script>
    EOQ;
    parent::display();
    echo $js;
    }
    }
    ?>

    pls give me the reply
    pls
    pls

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Hiding a tab but still showing the subpanels in related modules.
    By kenneth.thorman in forum Developer Help
    Replies: 6
    Last Post: 2009-08-13, 07:27 PM
  2. Replies: 2
    Last Post: 2008-04-19, 12:16 AM
  3. Hiding module subpanels with roles
    By eli.lindner in forum Developer Help
    Replies: 1
    Last Post: 2007-11-30, 08:59 AM
  4. Hiding subpanels
    By richardhakim in forum Help
    Replies: 2
    Last Post: 2006-11-27, 09:39 AM
  5. Help with hiding subpanels
    By stevec in forum Developer Help
    Replies: 1
    Last Post: 2006-07-14, 12:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •