Link to home
Start Free TrialLog in
Avatar of Bruce Gust
Bruce GustFlag for United States of America

asked on

Why does this switch / case not work?

Here's my code:

<?
      switch($eventtype){
        case "comment":
        case "text":
        case "note":
        ?>
          <?=$content?>
        <?
          break;
        case "statement":
            $dir_exists = $demo ? true : is_dir($dir);
            $file_exists = $demo ? true : file_exists($dir . $file);

            if($file_exists && $dir_exists) {
        ?>
            <a href='<?=$demo?'/admin/statement/?accountid='.$demo:'/admin/statement/load/'.$content?>' target='_statement'><img src='/assets/images/pdf_hover.png'/>View Statement</a>
        <?
            } else if($dir_exists) {
        ?>  
            <span class="error">Failed to send.</span>
        <? 
            } else {
        ?> 
            <span class="pending">Attempted to send... Pending feedback.</span>
        <?
            }
          break;
        case "transaction":
        ?>
        <div class='amount'><?=GlobalFunctions::formatMoney($amount)?><span class='float'>
          <span class='payer <?=$payer?>'><?=$payer?></span><span class='transtype <?=$transactiontype?>'><?=$transactiontype?></span>
        </div>
        <?if($dos !== null && $dos !=='1900-01-01'){?><div class="dos"><?='DOS : ' . date('M d, Y',strtotime($dos))?></div><?}?>
        <div class='encounter'><?if($encountercode != null){?>Encounter Code <?=$encountercode?><?}else{?>No encounter<?}?></div>
        <div class='description'>
          <?=$content?>
        </div>
        <?
          break;
        case "transactions":
        ?>
        <ul>
        <?foreach($transactions as $txn){
        ?>
        <li>
          <div class='amount'><?=GlobalFunctions::formatMoney($txn['amount'])?><span class='float'>
            <span class='payer <?=$txn['payer']?>'><?=$txn['payer']?></span><span class='transtype <?=$txn['transactiontype']?>'><?=$txn['transactiontype']?></span>
          </div>
          <?if($txn['dos'] !== null && $txn['dos'] !=='1900-01-01'){?><div class="dos"><?='DOS : ' . date('M d, Y',strtotime($txn['dos']))?></div><?}?>
          <div class='encounter'><?if($txn['encountercode'] != null){?>Encounter Code <?=$txn['encountercode']?><?}else{?>No encounter<?}?></div>
          <div class='description'>
            <?=$txn['content']?>
          </div>
          <div class='txntime'><?=Date('h:i A',strtotime($txn['eventdate']))?></div>
          <?/*if(isset($txn['runningbal'])){?>
           <div class='runningbal'>Running balance : <span><?=$txn['runningbal']?></span></div>
          <?}*/?>
        </li>
        <?}?>
        </ul>
		<?
		break;
		case "personal_payments":
		?>
		<ul>
        <?foreach($transactions as $txn_payer){
		if($txn_payer['payer']<>"I")
		{
			continue;
		}
		else
		{		
        ?>
        <li>
          <div class='amount'><?=GlobalFunctions::formatMoney($txn_payer['amount'])?><span class='float'>
            <span class='payer <?=$txn_payer['payer']?>'><?=$txn_payer['payer']?></span><span class='transtype <?=$txn_payer['transactiontype']?>'><?=$txn_payer['transactiontype']?></span>
          </div>
          <?if($txn_payer['dos'] !== null && $txn_payer['dos'] !=='1900-01-01'){?><div class="dos"><?='DOS : ' . date('M d, Y',strtotime($txn_payer['dos']))?></div><?}?>
          <div class='encounter'><?if($txn_payer['encountercode'] != null){?>Encounter Code <?=$txn_payer['encountercode']?><?}else{?>No encounter<?}?></div>
          <div class='description'>
            <?=$txn_payer['content']?>
          </div>
          <div class='txntime'><?=Date('h:i A',strtotime($txn_payer['eventdate']))?></div>
          <?/*if(isset($txn_payer['runningbal'])){?>
           <div class='runningbal'>Running balance : <span><?=$txn_payer['runningbal']?></span></div>
          <?}*/?>
        </li>
        <?
		}
		}?>
        </ul>
		<?php
      }
	?>

Open in new window


What you see is put into motion with a JavaScript code that changes the class assignment to different "<li>'s." That looks like this:

      $('input[name="filt"]').on('change',function(){
        if(this.value=='all'){
          if($(this).is(':checked')) $('input[name="filt"]').attr('checked', true);
          else $('input[name="filt"]').attr('checked', false);
        } else {
          $('input[name="filt"][value="all"]').attr('checked', false);
        }
        var show = [];
        var left = true;
        $('input[name="filt"]:checked').each(function(){
          show.push($(this).val());
        });
        var year = '';
        var month = '';
        $('.at_timeline_list li').each(function(){
          if($(this).hasClass('yearheader')){
            if(year && year.data('delete')) year.slideUp();
            else if(year) year.slideDown();
            year = $(this);
            year.data('delete', true);
          } else if($(this).hasClass('monthheader')){
            if(month && month.data('delete')) month.slideUp();
            else if(month) month.slideDown();
            month = $(this);
            month.data('delete', true);
          } else if($(this).hasClass('event')){
            if(show.indexOf($(this).data('type'))!=-1){
              $(this).removeClass('left').removeClass('right');
              $(this).addClass(left?'left':'right');
              left=!left;
              if($(this).css('display')!='list-item') $(this).slideDown();
              year.data('delete',false);
              month.data('delete',false);
            } else {
              if($(this).css('display')=='list-item') $(this).slideUp();
            }
          }
        });
        if(year && year.data('delete')) year.slideUp();
        else if(year) year.slideDown();
        if(month && month.data('delete')) month.slideUp();
        else if(month) month.slideDown();
      });

Open in new window


When I say "Everything works," I'm talking about all of the cases except for the one that I've been asked to add to the mix. That one is "personal_payments." When I click on the box like what you see pictured below...

User generated image
Nothing happens. I'm needing all of the transactions that don't have a green "P" to slip out of sight and nothing happens.

What am I missing?
SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bruce Gust

ASKER

Julian, here's the source code as well as a screen shot...

<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>  <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
  <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>PatientFocus: Client Portal</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="/assets/css/views/app2/bootstrap.min.css">
    <link rel="stylesheet" href="/assets/css/views/app2/bootstrap-responsive.min.css">
    <link rel="stylesheet" href="/assets/css/pepper-grinder/jquery-ui-1.8.21.custom.css">
    <link rel="stylesheet" href="/assets/css/views/app2/patientfocus.css">
    <link rel="stylesheet" href="/style/taskcolors/tasks.css">
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:300,600,400italic,700italic,400,700|Titillium+Web:400,700,300,600' rel='stylesheet' type='text/css'>
    <link href='/assets/images/app/favicon.png' rel='icon'>
    
        <script data-main="/assets/js/views/app_ang/main" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.14/require.min.js"></script>
    <script type="text/javascript">

        //GLOBAL SPACING
        var PAGELOAD_TIMESTAMP = Date.now();

        // This is crazy that I have to do this much to make this happen.
        // Eventually the pf library will be rebuilt and made sensible, and I'll use a modular
        // and Angular approach to build iteration 2.
        require.config({
            baseUrl : '/assets/js/views/app_ang',
            urlArgs: "t="+PAGELOAD_TIMESTAMP,
            waitSeconds : 0,
            paths: {
                'jquery' : '/assets/js/views/app2/jquery-1.8.2.min',
                'pf' : '/assets/js/pf/pf',
                'pf.apps' : '/assets/js/pf/apps',
                'pf.accounts'     : '/assets/js/pf/accounts',
                'pf.tables'       : '/assets/js/pf/tables',
                'pf.tasks'        : '/assets/js/pf/tasks',
                'pf.user'         : '/assets/js/pf/user',
                'pf.util'         : '/assets/js/pf/util',
                'pf.calls'        : '/assets/js/pf/calls',
                'pf.tickets'      : '/assets/js/pf/tickets',
                'pf.sounds'       : '/assets/js/pf/sounds',
                'pf.transactions' : '/assets/js/pf/transactions',
                'jsMVC' : '/assets/js/mvc/mvc',
                'AppPortal' : '/assets/js/views/app_ang/modules/AppPortal',
                'angular' : "//ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min",
                'angularMocks' : "//cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular-mocks",
                'angularRoutes' : "//cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular-route.min"
            }
        });
        //TODO::
        requirejs.config({
            shim: {
                '/assets/js/jquery.caret.1.02.min.js': ['jquery'],
                '/assets/js/jquery.loadView.js': ['jquery'],
                '/assets/js/views/app2/jquery.placeholder.min.js': ['jquery'],
                '/assets/js/views/app2/jquery.tagsinput.js': ['jquery'],
                '/assets/js/views/app2/jquery.dropkick-1.0.0.js': ['jquery'],
                '/assets/js/jquery.sortElements.js': ['jquery'],
                '/assets/js/jquery.history.js': ['jquery'],
                '/assets/js/jqueryDynamicInput.js': ['jquery'],
                '/assets/js/custom_radio.js': ['jquery'],
                '/assets/js/views/app2/jquery-ui-1.10.2.custom.min.js' : ['jquery'],
                '/assets/js/views/app2/custom_checkbox_and_radio.js' : ['jquery'],
                '/assets/js/views/app2/custom_radio.js' : ['jquery'],
                'jsMVC': ['jquery'],
                'pf':['jquery'],
                'pf.apps':['pf'],
                'pf.accounts' : ['pf'],
                'pf.tables' : ['pf','jsMVC'],
                'pf.tasks' : ['pf'],
                'pf.user' : ['pf'],
                'pf.util' : ['pf', 'jquery', 'jsMVC'],
                "/assets/js/views/app2/bootstrap.min.js" : ['jquery'],
                "angular" : {
                    "exports" : "angular"
                },
                "angularRoute" : ["angular"],
                "angularMocks" : {
                    deps : ["angular"],
                    exports : "angular.mock"
                }
            }
        });
    </script>

      <!--[if IE 8]>
    <link rel="stylesheet" href="assets/css/ie8.css">
  <![endif]-->
  
  <script src="/assets/js/views/app2/modernizr-2.6.2.min.js" type="text/javascript" charset="utf-8"></script>
  
</head>
<body class="development">
  <div class='devnot'>DEV ENVIRONMENT: Data is not live.</div>
    <header>
    <div class="container clearfix">
      <h1 class="home hide-text">PatientFocus <span class="entypo">⌂</span></h1>
      <h2 class="client" ng-controller="ClientSelector">
        <div class="dropdown select">
          <ul class="dropdown-menu">
              <li><a href="" data-value='' ng-click="changeClient('')">All Clients</a></li>
              <li><a href="" data-value='AIRCARE' ng-click="changeClient('AIRCARE')">Aircare Home Respiratory, a Verus Company</a></li><li><a href="" data-value='ALLEN' ng-click="changeClient('ALLEN')">Allen Parish Hospital</a></li><li><a href="" data-value='Amsurg' ng-click="changeClient('Amsurg')">Amsurg</a></li><li><a href="" data-value='AMG' ng-click="changeClient('AMG')">Anesthesia Medical Group</a></li><li><a href="" data-value='BCMH' ng-click="changeClient('BCMH')">Barton County Memorial Hospital, Lamar, MO</a></li><li><a href="" data-value='BBGH' ng-click="changeClient('BBGH')">Box Butte General Hospital</a></li><li><a href="" data-value='CMI' ng-click="changeClient('CMI')">Choice Medical</a></li><li><a href="" data-value='DALE' ng-click="changeClient('DALE')">Dale Medical Center</a></li><li><a href="" data-value='DHDC' ng-click="changeClient('DHDC')">Deer Creek</a></li><li><a href="" data-value='DCC' ng-click="changeClient('DCC')">Diabetes Care Club</a></li><li><a href="" data-value='DMH' ng-click="changeClient('DMH')">Doctors Memorial Hospital</a></li><li><a href="" data-value='ECH' ng-click="changeClient('ECH')">Elmore Community Hospital</a></li><li><a href="" data-value='EDA' ng-click="changeClient('EDA')">Endocrinology-Diabetes Associates</a></li><li><a href="" data-value='FCH' ng-click="changeClient('FCH')">Fishermen's Community Hospital</a></li><li><a href="" data-value='GAH' ng-click="changeClient('GAH')">Georgiana Hospital</a></li><li><a href="" data-value='DEMO' ng-click="changeClient('DEMO')">Gotham General Hospital</a></li><li><a href="" data-value='HCH' ng-click="changeClient('HCH')">Harrison County Hospital</a></li><li><a href="" data-value='HRMC' ng-click="changeClient('HRMC')">Hendry Regional Medical Center</a></li><li><a href="" data-value='DSCHD2' ng-click="changeClient('DSCHD2')">Hereford Regional Medical Center (DSCHD2)</a></li><li><a href="" data-value='DSCHD' ng-click="changeClient('DSCHD')">Hereford Regional Medical Center (DSCHD)</a></li><li><a href="" data-value='HOUCOHO' ng-click="changeClient('HOUCOHO')">Houston County Hospital</a></li><li><a href="" data-value='LMCH' ng-click="changeClient('LMCH')">Lake Martin Community Hospital</a></li><li><a href="" data-value='MCGH' ng-click="changeClient('MCGH')">Macon County General Hospital</a></li><li><a href="" data-value='SDP' ng-click="changeClient('SDP')">Medina Surgery Center</a></li><li><a href="" data-value='MERCY' ng-click="changeClient('MERCY')">Mercy Community Healthcare</a></li><li><a href="" data-value='NLI' ng-click="changeClient('NLI')">New Light Imaging</a></li><li><a href="" data-value='NWL' ng-click="changeClient('NWL')">Northwestern Louisiana Cancer Center</a></li><li><a href="" data-value='OVSH' ng-click="changeClient('OVSH')">Ohio Valley Surgical Hospital</a></li><li><a href="" data-value='ONCO' ng-click="changeClient('ONCO')">Oncologics</a></li><li><a href="" data-value='OHOI' ng-click="changeClient('OHOI')">One Hundred Oaks Imaging, LLC</a></li><li><a href="" data-value='OPTI' ng-click="changeClient('OPTI')">Optimal Radiology</a></li><li><a href="" data-value='PF' ng-click="changeClient('PF')">PatientFocuses</a></li><li><a href="" data-value='PCMG' ng-click="changeClient('PCMG')">Pecos County Memorial Hospital</a></li><li><a href="" data-value='EPLUS' ng-click="changeClient('EPLUS')">PET Imaging</a></li><li><a href="" data-value='PORTHO' ng-click="changeClient('PORTHO')">Premier Orthopaedics</a></li><li><a href="" data-value='RCC' ng-click="changeClient('RCC')">RxCareClub A-Z DiabetesCareClub</a></li><li><a href="" data-value='SMC' ng-click="changeClient('SMC')">Shoshone Medical Center</a></li><li><a href="" data-value='SHIC' ng-click="changeClient('SHIC')">Spring Hill Imaging Center</a></li><li><a href="" data-value='SMH' ng-click="changeClient('SMH')">Stephens Memorial Hospital</a></li><li><a href="" data-value='TRAD' ng-click="changeClient('TRAD')">Tennessee Oncology (TRAD)</a></li><li><a href="" data-value='TONC' ng-click="changeClient('TONC')">Tennessee Oncology (TONC)</a></li><li><a href="" data-value='TPS' ng-click="changeClient('TPS')">Tennessee PET Scan Company</a></li><li><a href="" data-value='TNRETINA' ng-click="changeClient('TNRETINA')">Tennessee Retina</a></li><li><a href="" data-value='TTT' ng-click="changeClient('TTT')">Test Transaction Transition</a></li><li><a href="" data-value='00077793111' ng-click="changeClient('00077793111')">TestClient2</a></li><li><a href="" data-value='TSC' ng-click="changeClient('TSC')">The Surgical Clinic</a></li><li><a href="" data-value='UGLA' ng-click="changeClient('UGLA')">Union General Hospital (UGLA)</a></li><li><a href="" data-value='UGH' ng-click="changeClient('UGH')">Union General Hospital (UGH)</a></li><li><a href="" data-value='URMC' ng-click="changeClient('URMC')">United Regional Medical Center</a></li><li><a href="" data-value='UTH' ng-click="changeClient('UTH')">United Telehealth Services (UTH)</a></li><li><a href="" data-value='UTS' ng-click="changeClient('UTS')">United Telehealth Services (UTS)</a></li><li><a href="" data-value='VIBM' ng-click="changeClient('VIBM')">Vanderbilt Belle Meade Imaging</a></li><li><a href="" data-value='CPAP' ng-click="changeClient('CPAP')">Verus Healthcare</a></li><li><a href="" data-value='CPAPNew' ng-click="changeClient('CPAPNew')">Verus Healthcare - NEW</a></li><li><a href="" data-value='WCH' ng-click="changeClient('WCH')">Wagoner Community Hospital</a></li><li><a href="" data-value='WMC' ng-click="changeClient('WMC')">Wiregrass Medical Center</a></li>          </ul>
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-value='TONC'>Tennessee Oncology (TONC)</a>
          <b class="active-icon"></b>
        </div><!-- end dropdown -->
      </h2><!-- end client -->
      <h3 class="user">
        <div class="dropdown">
          <a href="" class="dropdown-toggle" data-toggle="dropdown">Bruce Gust</a>
          <b class="active-icon"></b>
          <ul class="dropdown-menu">
                        <li><a id="spoofer" href="">Spoof</a></li>            <li><a id="manage_users">Manage Users</a></li>            <li><a id="my_settings" href="">My Settings</a></li>
            <li><a href="/logout">Logout</a></li>
          </ul>
        </div><!-- end dropdown -->
      </h3> 
    </div><!-- end container -->
  </header>
  <nav>
    <ul class="container clearfix openapps">
      <li>
        <div class="app-dropdown dropdown">
          <a href="" class="app-menu dropdown-toggle" data-toggle="dropdown">Apps</a>
          <ul class="dropdown-menu">
            <li><a class="demographics account-timeline" href="" endpoint="/app/accounttimeline" data-name="Account Timeline" data-category="demographics" data-description="View the communication and payment history of any patient in the system.">Account Timeline</a></li><li><a class="demographics communications" href="" endpoint="/app/communications" data-name="Communications" data-category="demographics" data-description="A breakdown of patient communications by day.">Communications</a></li><li><a class="demographics par-status" href="" endpoint="/app/parstatus" data-name="Par Status" data-category="demographics" data-description="View par collection and status information">Par Status</a></li><li><a class="financial invoices" href="" endpoint="/app/invoices" data-name="Invoices" data-category="financial" data-description="View your monthly invoices by opening this app.">Invoices</a></li><li><a class="financial posting" href="" endpoint="/app/posting" data-name="Posting" data-category="financial" data-description="This app displays real-time payments posted to our system. You may begin posting from this App instead of the invoice once you have spoken with your account representative. Give us a call when you are ready to start.">Posting</a></li><li><a class="financial weekly-collections-and-ar" href="" endpoint="/app/weeklycollectionsandar" data-name="Weekly Collections and AR" data-category="financial" data-description="View Placements, Adjustments and Overall AR by Week">Weekly Collections and AR</a></li><li><a class="tasks account-review" href="" endpoint="/app/accountreview" data-name="Account Review" data-category="tasks" data-description="View all the accounts we have reviews open on, and check them off one at a time.">Account Review</a></li><li><a class="tasks insurance-review" href="" endpoint="/app/insurancereview" data-name="Insurance Review" data-category="tasks" data-description="When a patient claims there is more insurance to be remitted on a claim, that account ends up in this list. If you go through on a line-by-line basis and clarify the situation for us, we can proceed with the billing process!">Insurance Review</a></li>          </ul>
        </div>
      </li><li class="demographics account-timeline navtab active">
        <a class="open" href="" data-endpoint="/app/accounttimeline">
          <span class="shift_baseline">Account Timeline</span>
        </a>
        <a href="" class="closeapp"> - Close</a>
      </li></ul>
  </nav>
  <div class="stage"><div class="tab" data-endpoint="/app/accounttimeline"><div class="widget app_account_timeline demographics  subheaded "
  data-appurl='/app/accounttimeline'
  >
  <div class="widget_header catbg"><div class="container">
    <span class="wh_appname" title="View the communication and payment history of any patient in the system."><!--Account Timeline-->Account Timeline</span>
    <!--<span id="wh_apptemplatename" title="View the communication and payment history of any patient in the system.">View the communication and payment history of any patient in the system.</span>-->
         <div class='rightcontrols'>
      <a href='' class="right pintodash"><span class='copy'>Pin to dashboard</span><span class='icon'></span></a>
          </div>
  </div>
  </div>
  <div class='widget_subhead catbg2'><div class="container">
    <div class="at_searchwrap clearfix"><input class="at_search" placeholder="Search by first name, last name, or accountid."/><span class="magnificon"></span></div>
    <ul class="at_filters">
      <li>
        <span class="checkbox">
          <input type="checkbox" name="filt" value="all" checked/>
        </span><label>All</label>
      </li>
      <li>
        <span class="checkbox">
          <input type="checkbox" name="filt" value="transaction" checked/>
        </span><label>Transactions</label>
      </li>
      <li>
        <span class="checkbox">
          <input type="checkbox" name="filt" value="statement" checked/>
        </span><label>Statements</label>
      </li>
      <li>
        <span class="checkbox">
          <input type="checkbox" name="filt" value="note" checked/>
        </span><label>Notes</label>
      </li>
      <li>
        <span class="checkbox">
          <input type="checkbox" name="filt" value="comment" checked/>
        </span><label>Task Comments</label>
      </li>
	  <li>
        <span class="checkbox">
          <input type="checkbox" name="filt" value="personal_payments" checked/>
        </span><label>Personal Payments</label>
      </li>
    </ul>
</div></div>  <div class="widget_wrapper"><!--<div class="account_timeline widget">
  <div class="at_title">
    <span class="widgetname">Patient History</span>
    <div class="searchbar">
      <input name="accountid"/>
      <div class="appicons search"></div>
    </div>
    <div class="closer"></div>
  </div>
  <div class="at_filters">
    <ul class="at_filterlist">
      <li>All</li>
      <li>Transactions</li>
      <li>Statements</li>
      <li>Notes</li>
    </ul>
  </div>-->
  <div class="container height100">
      <div class="bigwelcome">
      Begin by searching for a patient by name and/or account id, then press enter.
    </div>
  </div>
  </div>
</div><script type='text/javascript'>
  /*pf.onReady(function(){
    pf.util.loadViewAssets([
      '/assets/css/views/app/templates/accounttimeline.css',
      '/assets/js/views/app/templates/accounttimeline.js'
      ],'initTimeline');
  });*/
    require(['/assets/js/views/app/templates/accounttimeline.js'], function(init) {
        init();
    });
</script>
    </div></div>


    <script>
        var _gaq=[['_setAccount','UA-XXXXXXX-X'],['_trackPageview']];
        (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
        g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
        s.parentNode.insertBefore(g,s)}(document,'script'));
    </script>
    <div class="copyright">Copyright © 2016 PatientFocus</div>
</body>
</html> 

Open in new window


User generated image
I'm looking for the JavaScript code that coincides with the "filt" variable (Kim, I see your observation and I'll look into that here in a little bit).

Ray, you're right. I'll change that. That's peppered throughout this entire app.

Thank you, gentlemen. We are poised on the threshold of great things!
Ok, everything under the sun in there including angular .... and judging by the code submitted this is not really a proper Angular application - there is only one controller in that source and it is confined to the <h2> - I can't even begin to imagine how the rest of the code has been structured.

Bottom line without a working link or the full code base we are going to be hard pressed to help you.

From the source
// This is crazy that I have to do this much to make this happen.
// Eventually the pf library will be rebuilt and made sensible, and I'll use a modular
// and Angular approach to build iteration 2.

Open in new window

Julian!

I'm going to close this question, just because there's more to it than what's fair to ask any ninja to deconstruct, however... And Kim, this is for you as well:

I still need to understand what's in front of me, so I'm breaking the JS that I have down bit by bit. The first question is at https://www.experts-exchange.com/questions/28961513/How-does-this-Javascript-work.html. Feel free to weigh in.

And Julian, where is the Angular? I looked that up to see what it is, but I don't recognize what I've got above as having anything than just your basic JS. Let me know if you would.

Thanks, guys!
Take a look at line 48 - require is trying to load the angular 1.2.6 library. Also refer to the comment I cut from the code - in my previous post.

Angular in 10 seconds ...
It is a JavaScript framework for building client side applications (often called Single Page Applications). It is based on an MVC framework and a methodology called 2 way binding - you create your model (basically JS objects) and you bind those to the view (HTML Templates) - Angular handles the two way interaction between the two. So if you change the model - say with an AJAX call - the view automatically updates. Likewise - if you change the view (click something or type something into a control) it automatically updates the model.  It takes a bit of getting used to but once you have a handle on it there is no other way to build web based applications (in my view).

This project looks like something that has grown and been added to overtime and is overdue for a refactor - or rewrite.

If the page you are wanting to change is Angular based - then you would need to look in the model and controller for the page to see how to interact with the new checkbox.

If it is not using Angular then you would need to find where the click on the filt checkboxes is handled and deal with it there.