Select2 and autocomplete

Select2 and autocomplete

d052057d052057 Posts: 38Questions: 3Answers: 0

I did download select2 and jquery-uf in order to use select2 and autocomplete features, but they don't work.
I get 'autocomplete' error "0x800a139e - JavaScript runtime error: Error adding field - unknown field type autocomplete"

Can anyone direct me to how to example for select2 and auto

Replies

  • d052057d052057 Posts: 38Questions: 3Answers: 0
    edited December 2018
    var bolDetailTbl = '#bolShipmentDetail';
    var bolDimTbl = '#bolDimension';
    var dim_editor;
    var bol_editor;
    var dataList = [{ "Desc": "yitong" }, { "Desc": "phou" }];
    
    $(document).ready(function () {
        bol_editor = new $.fn.dataTable.Editor({
            table: bolDetailTbl,
            fields: [
                {
                    label: "Piece Count",
                    name: "Piece",
                },
                {
                    label: "Pkg Type",
                    name: "Pkg"
    
                },
                {
                    label: "Hazmat (Check)",
                    name: "Hazmat"
                },
                {
                    label: "Kind of Package,Description of Articles,Special Marks and Exceptions",
                    name: "Kind",
                    type: "autocomplete",
                    opts: dataList
                },
                 {
                     label: "NMFC Class",
                     name: "Class"
                 },
                  {
                      label: "NMFC Item",
                      name: "Item"
                  },
                   {
                       label: "Weight Subj. To Correction (lbs)",
                       name: "Weight"
                   }
            ]
    
        });
    
  • colincolin Posts: 15,146Questions: 1Answers: 2,586

    Hi @d052057 ,

    This page here might give some clues - it's not exactly the same but some of the debug/diagnostic steps would be relevant. If no joy, would you be able to link to your page?

    Cheers,

    Colin

  • d052057d052057 Posts: 38Questions: 3Answers: 0

    Thank you for the link. It is very helpful. I am able to do 'autocomplete' now.
    How about the 'select2'. I did download the select2.js but it still doesn't recognized the type?

    Please, a link?

  • kthorngrenkthorngren Posts: 20,317Questions: 26Answers: 4,772

    What have you configured?

    What happens when trying to use that field?

    Does the field work as a normal select?

    I don't know of any running examples with select2.

    Kevin

  • colincolin Posts: 15,146Questions: 1Answers: 2,586

    Hi @d052057 ,

    There's a few threads, here and here, where select2 fields are configured, there's no running examples but they might act as a guide. If not, would you be able to post your initialisation code or link to your page/create test case?

    Cheers,

    Colin

This discussion has been closed.