Javascript item in list of select element
up vote
-1
down vote
favorite
I have list item with checkbox. when the item is selected, put it in the list.
now, I need to indicate by input which one will be first in the list and etc...
if i remove the item by checkbox i also need to manage others items selected
I don't have any idea to implement that
this is my code for checkbox.
selectedEvent(rowData)
const index = this.isAlreadyDone ? rowData.EventId : rowData.file.EventId;
const item = this.EventsSelected.indexOf(index.toString());
if (item > -1 && !rowData.EventId)
this.EventsSelected = this.EventsSelected.filter(item => item !== index.toString());
else
if (rowData.EventId)
this.EventsSelected.push(index.toString());
javascript arrays angular sorting
|
show 3 more comments
up vote
-1
down vote
favorite
I have list item with checkbox. when the item is selected, put it in the list.
now, I need to indicate by input which one will be first in the list and etc...
if i remove the item by checkbox i also need to manage others items selected
I don't have any idea to implement that
this is my code for checkbox.
selectedEvent(rowData)
const index = this.isAlreadyDone ? rowData.EventId : rowData.file.EventId;
const item = this.EventsSelected.indexOf(index.toString());
if (item > -1 && !rowData.EventId)
this.EventsSelected = this.EventsSelected.filter(item => item !== index.toString());
else
if (rowData.EventId)
this.EventsSelected.push(index.toString());
javascript arrays angular sorting
3
could you clarify the question with example and code
– hana_wujira
19 hours ago
You have the example in image
– Hassan BAHA
19 hours ago
Please, always add a Minimal, Complete, and Verifiable example to your question.
– evolutionxbox
19 hours ago
I added my code for selected item by checkbox but i dont know if it is helpful *$
– Hassan BAHA
19 hours ago
What do you mean by if i remove the item by checkbox i also need to manage others items selected? Also, what if the user types in a sort order randomly? like58
and2
for eg for the items that you're showing? Will your list allow that? Or will it have just the items and it won't allow.
– SiddAjmera
18 hours ago
|
show 3 more comments
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I have list item with checkbox. when the item is selected, put it in the list.
now, I need to indicate by input which one will be first in the list and etc...
if i remove the item by checkbox i also need to manage others items selected
I don't have any idea to implement that
this is my code for checkbox.
selectedEvent(rowData)
const index = this.isAlreadyDone ? rowData.EventId : rowData.file.EventId;
const item = this.EventsSelected.indexOf(index.toString());
if (item > -1 && !rowData.EventId)
this.EventsSelected = this.EventsSelected.filter(item => item !== index.toString());
else
if (rowData.EventId)
this.EventsSelected.push(index.toString());
javascript arrays angular sorting
I have list item with checkbox. when the item is selected, put it in the list.
now, I need to indicate by input which one will be first in the list and etc...
if i remove the item by checkbox i also need to manage others items selected
I don't have any idea to implement that
this is my code for checkbox.
selectedEvent(rowData)
const index = this.isAlreadyDone ? rowData.EventId : rowData.file.EventId;
const item = this.EventsSelected.indexOf(index.toString());
if (item > -1 && !rowData.EventId)
this.EventsSelected = this.EventsSelected.filter(item => item !== index.toString());
else
if (rowData.EventId)
this.EventsSelected.push(index.toString());
javascript arrays angular sorting
javascript arrays angular sorting
edited 19 hours ago
asked 19 hours ago
Hassan BAHA
588
588
3
could you clarify the question with example and code
– hana_wujira
19 hours ago
You have the example in image
– Hassan BAHA
19 hours ago
Please, always add a Minimal, Complete, and Verifiable example to your question.
– evolutionxbox
19 hours ago
I added my code for selected item by checkbox but i dont know if it is helpful *$
– Hassan BAHA
19 hours ago
What do you mean by if i remove the item by checkbox i also need to manage others items selected? Also, what if the user types in a sort order randomly? like58
and2
for eg for the items that you're showing? Will your list allow that? Or will it have just the items and it won't allow.
– SiddAjmera
18 hours ago
|
show 3 more comments
3
could you clarify the question with example and code
– hana_wujira
19 hours ago
You have the example in image
– Hassan BAHA
19 hours ago
Please, always add a Minimal, Complete, and Verifiable example to your question.
– evolutionxbox
19 hours ago
I added my code for selected item by checkbox but i dont know if it is helpful *$
– Hassan BAHA
19 hours ago
What do you mean by if i remove the item by checkbox i also need to manage others items selected? Also, what if the user types in a sort order randomly? like58
and2
for eg for the items that you're showing? Will your list allow that? Or will it have just the items and it won't allow.
– SiddAjmera
18 hours ago
3
3
could you clarify the question with example and code
– hana_wujira
19 hours ago
could you clarify the question with example and code
– hana_wujira
19 hours ago
You have the example in image
– Hassan BAHA
19 hours ago
You have the example in image
– Hassan BAHA
19 hours ago
Please, always add a Minimal, Complete, and Verifiable example to your question.
– evolutionxbox
19 hours ago
Please, always add a Minimal, Complete, and Verifiable example to your question.
– evolutionxbox
19 hours ago
I added my code for selected item by checkbox but i dont know if it is helpful *$
– Hassan BAHA
19 hours ago
I added my code for selected item by checkbox but i dont know if it is helpful *$
– Hassan BAHA
19 hours ago
What do you mean by if i remove the item by checkbox i also need to manage others items selected? Also, what if the user types in a sort order randomly? like
58
and 2
for eg for the items that you're showing? Will your list allow that? Or will it have just the items and it won't allow.– SiddAjmera
18 hours ago
What do you mean by if i remove the item by checkbox i also need to manage others items selected? Also, what if the user types in a sort order randomly? like
58
and 2
for eg for the items that you're showing? Will your list allow that? Or will it have just the items and it won't allow.– SiddAjmera
18 hours ago
|
show 3 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53224123%2fjavascript-item-in-list-of-select-element%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
3
could you clarify the question with example and code
– hana_wujira
19 hours ago
You have the example in image
– Hassan BAHA
19 hours ago
Please, always add a Minimal, Complete, and Verifiable example to your question.
– evolutionxbox
19 hours ago
I added my code for selected item by checkbox but i dont know if it is helpful *$
– Hassan BAHA
19 hours ago
What do you mean by if i remove the item by checkbox i also need to manage others items selected? Also, what if the user types in a sort order randomly? like
58
and2
for eg for the items that you're showing? Will your list allow that? Or will it have just the items and it won't allow.– SiddAjmera
18 hours ago