Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7641361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:54:09+00:00 2026-05-31T08:54:09+00:00

Based on my previous thread I’m trying to use ExtJS to call a function

  • 0

Based on my previous thread I’m trying to use ExtJS to call a function from a PHP class that lives in another area. Is this even possible or should I create a new PHP and simply pass it args? I’d prefer to use my existing code so I’m not duplicating it.

My current PHP Class handles my DB connection etc but I have no idea how or if I can instantiate the class and call a function using ExtJS.

<?php

class productInfo extends productInterface {

....

    function getProducts($code) {

        if (!$this->isConnected())
            $this->connect();

        $products = null;

        $query = "SELECT id, product FROM products Where id =  $code";

        $result = $this->dbConnection->exec_query($query);
        if ($result){
            while($row = $this->dbConnection->fetch_array($result)) {
                $products [$row['id']] = $row['product '];
            }
        }

        return $products ;
    }
}

?>

Client side code:

<select id="productFamily" onchange="getProducts()">
<option value="select">Select</option>
    ...
</select>

ExtJs

function getProducts(productFamily){

    var value = Ext.get("productFamily").dom.options[Ext.get("productFamily").dom.selectedIndex].value;

    Ext.Ajax.request({
            // How do I call getProducts(value) from ExtJS ???
    });
}

Is this possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T08:54:10+00:00Added an answer on May 31, 2026 at 8:54 am

    drgomesp’s recommendation is definitely the easiest way to go.

    However, there is a way to expose your server side API for use with ExtJS. If you really want to use your PHP functions via ExtJS, check out Ext Direct:

    http://www.sencha.com/products/extjs/extdirect

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to call a method that requires some parameters based on previous
I'm trying to populate new select menu (#school) from db table based on previous
Based on my previous question here and here , I found that I can
Based on a previous question and with a lot of help from Damir Sudarevic
Suppose I have a custom collection class that provides some internal thread synchronization. For
Based on my previous thread : RVM installed by Ruby not working? where i
Based on my previous question , I've trying now to have them in the
I have a C# application that communicates with a PHP-based SOAP web service for
I have a handle-based class that I need to create a vector of. An
I'm trying to sort an array, from a previous post I was pointed to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.