QCubed 2.0.0 and QAutoCompleteTextBox plugin FIX

Login or register to post comments
5 replies [Last post]
Offline
Joined: 05/19/2009

QCubed saved me a lot of time, and now i feel in debt with of this community because of the effort and invested time.

While testing QCubed 2.0.0 with the QAutoCompleteTextBox plugin, i noticed that this plugin needs to be modified due to the inclusion of JQuery so i got working this way:

In QAutoCompleteTextBoxBase.class.php modified the GetEndScript() method, added GetActionAttributes because it uses jquery event binding, and it puts all this code at the end of the script:

<?php
public function GetEndScript() {
    if(!
$this->blnVisible || !$this->blnEnabled ) {
        return
'';
    }
   
$strToReturn = $this->GetScript()."\r\n";
   
$strToReturn.= $this->GetActionAttributes();
    return
$strToReturn;
}
?>

In QJavaScriptAutoCompleteTextBox.class.php modified the return string of GetScript() method (noticed that the framework uses jquery in compatibility mode so $ becomes $j):

<?php
return sprintf('$j("#%s").autocomplete(%s,{%s%s%s%s%s%s%s});',
   
$this->strControlId,
   
$strJavascriptArray,
   
"minChars:" . $this->intMinChars,
    ((
$this->blnAutoFill)         ? ",autoFill:true" : ""),
    ((
$this->blnMatchContains)     ? ",matchContains:true" : ""),
    ((
$this->blnMatchCase)         ? ",matchCase:true" : ""),
    ((
$this->blnMustMatch)        ? ",mustMatch:true" : ""),
    ((
$this->Width)            ? ",width:" . $this->Width :""),
    ((
$this->strTextMode == QTextMode::MultiLine) ? ",multiple:true" : "")
);
?>

The same patch works for QAjaxAutoCompleteTextBox. If i lost something i would appreciate all the comments.

Josue Balbuena / MX

Offline
Joined: 07/10/2008

Great, if you could create a ticket in trac we can have the community contribute / review the work. It's very simple, just click tickets, and add a new ticket. :)

Offline
Joined: 05/19/2009

commited ticket #559

alex94040's picture
Offline
Joined: 11/06/2008

Correction: ticket #559 is NOT committed to the SVN yet, it's just opened, and has some great details in there

Offline
Joined: 05/19/2009

woops! who can commit to SVN ?

Offline
Joined: 03/31/2008

I think it's just a terminology mix-up. :) Commit means that the code is now live in our main branch, and will be part of the next release.

Creating tickets, and even submitting patches to them do not cause an automatic commit.