Skip to content
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

Ability to set a tags like label/value pairs. Advanced server side integration. #360

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Defee
Copy link

@Defee Defee commented Apr 16, 2016

Hello, @aehlke !
My team want to commit some changes on master branch and help you with a maintainance a little bit. We can discuss changes if it is something wrong.
Here is the issues that can be closed after this commits: #80 #350 #285 #266 #269 #160 #70

  1. Added @value component@ to tags. It creates a new input as a value. Also it uses a new option @valueFieldName@. It was done for a server side better integration.
  2. Create Tag now can handle a @DaTa@(object) instead of a @value@ (array or primitive).
  3. if you provide a single input option + you return a label/value array from server, the value is saved in value attribute of input. if new value is added it will be added as string.TODO: store a label|value pair.
  4. if you return ONLY a label array from server and single input is false, the @Label@ and @value@ inputs has the same value. 5)If we add new input and single input is false, the @Label@ and @value@ inputs has the same value.
  5. Allows predefined values from markdown.

…ork properly with label/value autocomplete."

This reverts commit 96242ec.
1)Added @value component@ to tags. It creates a new input as a value. Also it uses a new option @valueFieldName@. It was done for a server side better integration.
2) Create Tag now can handle a @DaTa@(object) instead of a @value@ (array or primitive). All methods were rewritten and tested.
3) if you provide a single input option + you return a label/value array from server, the value is saved in value attribute of input. if new value is added it will be added as string.
TODO: store a label|value pair.
4) if you return ONLY a label array from server and single input is false, the @Label@ and @value@ inputs has the same value. 5)If we add new input and single input is false, the @Label@ and @value@ inputs has the same value.
@vijaysebastian
Copy link

can you please show me the example page. I am new in front end scripting

@vijaysebastian
Copy link

Here is my code:

$("#asset").tagit({
    autocomplete: ({
        source: function (request, response) {
            $.ajax({
                url: "MyURL",
                data: {format: "json", query: request.term},
                dataType: 'json',
                type: 'GET',
                success: function (data) {
                    response($.map(data, function (item) {
                        console.log(item);
                        return {
                            label: item.name,
                            value: item.id
                        }
                    }));
                },
                error: function (request, status, error) {
                   console.log(error);
                }
            })
        },
        minLength: 1,

    })
});

But when i select label, the input field populate with id. On UI screen it should show labels and when I submit the form it should post only ids'. Please help me

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

Successfully merging this pull request may close these issues.

2 participants