Skip to content

Instantly share code, notes, and snippets.

@moshfeu
Created July 5, 2020 09:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save moshfeu/b934f5b2deec73e7fe7c56ae9eb0ad4f to your computer and use it in GitHub Desktop.
Save moshfeu/b934f5b2deec73e7fe7c56ae9eb0ad4f to your computer and use it in GitHub Desktop.
const select = $("#pipe_name" + j)
.select2({
placeholder: '-- Choose Pipe Name --',
theme: "bootstrap",
width: '100%'
})
.html('');
.append('<option value="">-- Choose Pipe Name --</option>');
$.ajax({
url: url,
type: 'GET',
dataType: 'json',
success: function(result) {
for (i = 0; i < result.length; i++) {
select.append('<option value="' + result[i].code + '">' + result[i].code + '|' + result[i].name + '|' + result[i].unit + '</option>');
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment