CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • ajax call from case create form returns the case dashboard??
Pages: 1 [2]

Author Topic: ajax call from case create form returns the case dashboard??  (Read 1425 times)

dlats

  • I post occasionally
  • **
  • Posts: 77
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal 7.12
  • MySQL version: 5.0.91
  • PHP version: 5.2.17
Re: ajax call from case create form returns the case dashboard??
June 17, 2014, 08:49:27 am
That's not it. I tried the same code on a site that doesn't have the error and the autocomplete still doesn't work.

Here is the html ;

<tr class="crm-case-form-block-type_dog_name">
      <td class="label"></td>
      <td class="view-value">
        <input name="type_dog_name" type="text" id="type_dog_name" class="form-text" />
         <span class="description">Type dog's name.</span>
      </td>
    </tr

The js is

cj(document).ready(function(){

  cj("#type_dog_name").autocomplete( {
     source: ["Fido","Fideaux","Fidough"]
  });

}); // doc ready


Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: ajax call from case create form returns the case dashboard??
June 17, 2014, 10:54:25 am
The autocomplete function in CiviCRM is a somewhat older version--you may need to check manually how it works precisely--the syntax is not exactly as it is today.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

dlats

  • I post occasionally
  • **
  • Posts: 77
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal 7.12
  • MySQL version: 5.0.91
  • PHP version: 5.2.17
Re: ajax call from case create form returns the case dashboard??
June 17, 2014, 11:40:57 am
I really want to call the api extension that I wrote using something like

var contactUrl = "/civicrm/ajax/rest?extensionName=dog&fnName=get&json=1&type=all";

cj("#type_dog_name").autocomplete( {
  contactUrl
});

What url should I use?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: ajax call from case create form returns the case dashboard??
June 17, 2014, 01:06:41 pm
I do not know for sure, but review my code in http://forum.civicrm.org/index.php/topic,33068.msg141008.html#msg141008 and note that the source URL goes before the {}.

This is one point that I think is different than today's syntax for autocomplete.

Perhaps review the existing code for samples of autocomplete in CiviCRM to understand better which URL to use.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

dlats

  • I post occasionally
  • **
  • Posts: 77
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal 7.12
  • MySQL version: 5.0.91
  • PHP version: 5.2.17
Re: ajax call from case create form returns the case dashboard??
June 17, 2014, 02:41:21 pm
Indeed, this is an old deprecated/unsupported and undocumented version (1.0.2) of a jQuery plugin.

By looking at examples, the code that works for the simple case is

cj("#id").autocomplete(source, {}); where var source = ["Fido","Fideaux"];

Nex I'll figure out how to get results from my api extension.

Pages: 1 [2]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • ajax call from case create form returns the case dashboard??

This forum was archived on 2017-11-26.