8000 Jquery UI Autocomplete function in input · Issue #115 · volosoft/jtable · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Jquery UI Autocomplete function in input #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rbigliazzi opened this issue Jan 23, 2013 · 13 comments
Closed

Jquery UI Autocomplete function in input #115

rbigliazzi opened this issue Jan 23, 2013 · 13 comments
Labels

Comments

@rbigliazzi
Copy link

Hello everyone, Anyone know how to insert a function of jquery ui autocomplete in the form field.

Thanks

@hikalkan
Copy link
Member

You can use any of jquery auto complete plugin or jQueryUI's autocomplete. Just use input (http://jtable.org/ApiReference#fopt-input) option of jTable to create your custom field. It's easy.
I think to built-in-integration with autocomplete of jQueryUI in the future.

@rbigliazzi
Copy link
Author

Thanks, but it did not work. When I created the field outside the create form, the autocomplete function works. Following is the piece of code:

tipo_envio: {
title: 'Send Mode'
create: true,
edit: false,
input: function (data) {
return '';
}

thank you

@hikalkan
Copy link
Member

I used formCreated (http://jtable.org/ApiReference#event-formCreated) event to bind autocomplete as shown below:

$('#StudentTableContainer').jtable({
    //...
    actions: {
        //...
    },
    fields: {
        StudentId: {
            key: true,
            create: false,
            edit: false,
            list: false
        },
        ProgrammingLanguage: {
            title: 'Programming Language'
        }
        //...
    },
    formCreated: function (event, data) {
        var availableTags = [
          "ActionScript",
          "AppleScript",
          "Asp",
          "BASIC",
          "C",
          "C++",
          "Clojure",
          "COBOL",
          "ColdFusion",
          "Erlang",
          "Fortran",
          "Groovy",
          "Haskell",
          "Java",
          "JavaScript",
          "Lisp",
          "Perl",
          "PHP",
          "Python",
          "Ruby",
          "Scala",
          "Scheme"
        ];
        
        data.form.find('[name=ProgrammingLanguage]').autocomplete({
            source: availableTags
        });
    }
});

And it worked:

jtable-autocomplete-example

You can use autocomplete as documented here: http://jqueryui.com/autocomplete/

@rbigliazzi
Copy link
Author

Works , best table plugin @hikalkan

@hikalkan
Copy link
Member

Thanks for using it ;)

@rbigliazzi
Copy link
Author

Realized the translation of messages for Portuguese (Brazil), how can I be sending? thank you @hikalkan

@hikalkan
Copy link
Member

Please copy it here. I wll include it in jTable with your name.

@rbigliazzi
Copy link
Author

/*
jTable localization file for 'Portuguese - Brazilian' language.
Author: Renato Bigliazzi
*/

(function ($) {

$.extend(true, $.hik.jtable.prototype.options.messages, {
    serverCommunicationError: 'Erro ao tentar conexão com o servidor.',
    loadingMessage: 'Carregando registros...',
    noDataAvailable: 'Não existem dados a serem exibibos no momento!',
    addNewRecord: '+ Adicionar novo registro',
    editRecord: 'Editar registro',
    areYouSure: 'Você tem certeza ?',
    deleteConfirmation: 'Este registro será excluido. Confirmar ?',
    save: 'Salvar',
    saving: 'Salvando...',
    cancel: 'Cancelar',
    deleteText: 'Excluir',
    deleting: 'Excluindo...',
    error: 'Erro',
    close: 'Fechar',
    cannotLoadOptionsFor: 'Não foi possivel carregar opções para o campo {0}!',
    pagingInfo: 'Exibindo registros {0} a {1} de {2}',
    canNotDeletedRecords: 'Não foi possível excluir registro(s) {0} de {1}!',
    deleteProggress: 'Excluindo {0} de {1} registros, processando...'
});

})(jQuery);

@hikalkan
Copy link
Member

Thanks again. What is the language code for that. I mean the file name. For example, it's jquery.jtable.tr.js for Turkish language. What must be in Portuguese - Brazilian? Is jquery.jtable.pt-BR.js OK?

@rbigliazzi
Copy link
Author

Perfectly. Thanks @hikalkan

@acdigital
Copy link

Hello, novice here.
Why this is not working?

                                                /*piece_composer: {
                                                    title: 'Composer',
                                                    width: ''
                                                },*/
                                                
                                                piece_composer: {
                                                title: 'Composer',
                                                width: ''
},                                              }
formCreated: function (event, data) {
        var availableTags = [
          "ActionScript",
          "AppleScript",
          "Asp",
          "BASIC",
          "C",
          "C++",
          "Clojure",
          "COBOL",
          "ColdFusion",
          "Erlang",
          "Fortran",
          "Groovy",
          "Haskell",
          "Java",
          "JavaScript",
          "Lisp",
          "Perl",
          "PHP",
          "Python",
          "Ruby",
          "Scala",
          "Scheme"
        ];
        
        data.form.find('[name=piece_composer]').autocomplete({
            source: availableTags
        });
    }
});
    

@stiz1981
Copy link

how can i fill
var availableTags
from date base data?

i do this - with jquery ui work fine -
formCreated: function (event, data) {
$('#Edit-k_name').keyup(function(){
function log( message ) {
$( "#Edit-k_adres" ).html(message);
}
$( "#Edit-k_name" ).autocomplete({
source: "GetContra.php",
minLength: 4,
select: function( event, ui ) {
log( ui.item.id );
}
});

                 });               
                  }

http://jqueryui.com/autocomplete/#remote

maybe some one this help in build search in input

@mansoorzamani
Copy link

Could give an example of autocomplete dropdown list in asp.net mvc

Sorry, something went wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
0