question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extend item coupling

See original GitHub issue

sorry, my English is not very good. i hope have a item display to handle the function, but does not involve the creation of LI, just return Li data

as follows:

item: function(text, input) {
    // in my code, the text is object, i need to convert string
    var title = text.label.liName;
    var html = input === '' ? text : text.replace(RegExp($.regExpEscape(input.trim()), "gi"), "<mark>$&</mark>");
    return {
        innerHTML: html,
        "aria-selected": "false"
    };
}

and i don’t have to care how to generate li dom, hope to separate the data and the view. Just a suggestion. Thank you very much for providing such a good plugin.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Apr 25, 2016

My manners are fine thank you. And thank you for providing proper instructions on how to ‘unsubscribe’, on this my third attempt. Most sites make the ‘unsubscribe’ process simple, mostly because they’re required to. GitHub does not, as clearly I am not the first person to attempt to unsubscribe only to be harassed more for my efforts.

I signed up for the site. You should worry more about your grammar, your ability to understand an issue and your ability to construct a point than others’ manners.

Thank you, Stacey

On Apr 23, 2016, at 8:54 PM, Lea Verou notifications@github.com wrote:

Sigh. You need to unsubscribe from the entire repo. You probably unsubscribed from that one discussion. See this button?

Click it and select “Not watching”.

Also, you might need to work on your manners. Nobody here is responsible for whoever subscribed to this repo with your email. Direct the rudeness to whoever 20 year old in your family registered here with your email.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub

1reaction
vlazarcommented, Apr 19, 2016

@LeaVerou you are absolutely right.

If @cenxun you question was about changing item data without providing a custom item function (which is a render function), then you can use data function to modify original item data.

Each item in Awesomplete can have a label and value if needed. For simple case with items as strings internal item label and value are the same.

Here is an example of how to add "Modified " string for each item label:

If original items list is an array of strings.

data: function (item, input) {
    return "Modified " + item;
}

If original items list is an array of objects with label and value keys.

data: function (item, input) {
    return { label: "Modified " +  item.label, value: item.value };
}

If original items list is an array of arrays where first element in item array is label and the second is value.

data: function (item, input) {
    return [ "Modified " +  item[0], item[1] ];
}

See docs about data function in this section http://leaverou.github.io/awesomplete/#extensibility. And email autocomplete example here http://leaverou.github.io/awesomplete/#advanced-examples.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plumb Pak PP21215 Flex 'N Fix Extension Coupling, 1-1/2 ...
Flexible Extension Coupling for kitchens bathrooms; Inlet: 1-1/2" or 1-1/4" with included reducer washer. Outlet: 1-1/2". Length: 4-1/2"-8-1/2"; Double Slip ...
Read more >
Item # 41504, Coupling (Extension) Nuts On TE-CO
Coupling Nuts can be used to join two or more studs for a desired length. Many sizes conform to TCMAI standards; Standard package...
Read more >
VIEGA PROPRESS Extended Coupling - 4RCL7 - Grainger
Extended Coupling. Item # 4RCL7; Mfr. Model # 78223; UNSPSC # 40142315; Catalog Page # N/A. Country of Origin Germany. Country of Origin...
Read more >
How to Extend the Life of Your Coupling - Regal Rexnord
But there are steps you can take to extend the life of your coupling (and maybe even learn something about your equipment operating...
Read more >
GF Contain-It Coupling - Extended
ALSCO - Guaranteed low prices on GF Contain-It Coupling - Extended. ... Note: This is a special order item with minimum quantity purchase...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found