Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

(HIGH) Ajax select boxes changes not applying 01 Jul 2015 14:43 #13305

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
I have altered the following code in my view.php.html file to filter the contents of a select box

From
$model_second_line_grp = CkJModel::getInstance('Oncallareas', 'RtcalloutModel');
        $model_second_line_grp->addGroupOrder("a.area");

        $lists['fk']['second_line_grp'] = $model_second_line_grp->getItems();

to
$model_second_line_grp = CkJModel::getInstance('Oncallareas', 'RtcalloutModel');
        $model_second_line_grp->addWhere("a.second_line=1");
        $model_second_line_grp->addGroupOrder("a.area");

        $lists['fk']['second_line_grp'] = $model_second_line_grp->getItems();

I have tried this change in both a FORK and in the core file. However the SELECT box is not applying the WHERE statement

When I look at DEBUG mode, I see that the query has been created (and checks out in MYSQL with the correctly filtered results) but there is ALSO a query for selecting every single record. It is this unfiltered list that appears to be applying to my dropdown i.e query 15 and not 17 in the debugging

Here are the queries

15 -
SELECT a.id,a.created_by,a.published,a.*

  FROM p17oj_rtcallout_oncallparents AS a

  WHERE (a.created_by = 40 OR 1) 
  AND (a.published = 0 OR a.published = 1 OR a.published IS NULL)

  ORDER BY a.name,a.ordering asc

17 -
SELECT a.id,a.created_by,a.published,a.*

  FROM p17oj_rtcallout_oncallareas AS a

  WHERE (a.created_by = 40 OR 1) 
  AND (a.published = 0 OR a.published = 1 OR a.published IS NULL) 
  AND a.second_line=1

  ORDER BY a.area,a.ordering asc

Looking in the view php file, I can see that the results are being called for second_line_grp, but wondering if the ajax is just pulling in the default list
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.079 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started