Hey everybody, I am trying to resolve my problem with custom list in SharePoint 2013.
In my list I have 3 dropdown items -
Parent
Child
Child1
When I select specific item in Parent, values for Child will change.
After that I will select specific item in Child, also values for Child1 will change.
I make this with javascript but now I want to change that.
I would like to make it like that - Parent - specific value (user can't change the value)
Child - specific value (user can't change the value) - specific value will refresh Child1 and user can select one option.
Piece of code -
function nastavSluzba(){
$('#Produktova_Skupina_Sluzba').find('select').select('');
$('#Vyber_Oblasti').find('select').val('')
$('#tableNapoveda').remove();
$("#Vyber_Oblasti").find('select').attr("disabled", false);
$("#Produktova_Skupina_Sluzba").find('select').attr("disabled", false);
$("#Vyber_Oblasti").find('select').css({"background-color": "white","color": "black"});
}
function nastavPytam(){
$('#Pytam_Sa_Na').find('select').find('option').remove().end().append('<option value="0">(None)</option>').val(0);
$('#Produktova_Skupina_Sluzba').find('select').select(function() {
$('#Pytam_Sa_Na').find('select').find('option').remove().end().append('<option value="0">(None)</option>').val(0);
zmenDefaultHodnotySelectov();
hideDoplnujuce();
getSluzba(list_komponenty,$(this).find(":selected").text(),$("#Vyber_Oblasti").find(":selected").text(),function(id,psn,tim){
$("#Pytam_Sa_Na").find('select').append("<option value='"+id+"'>"+psn+"</option>");
});
$('#tableNapoveda').remove();
getNapoveda(list_napoveda,$(this).find(":selected").text(),function(znenie,napoveda){
console.log(znenie,napoveda);
//$("#Pytam_Sa_Na").after(znenie,napoveda);
$('#tableNapoveda tr:last').after('<tr><td>'+znenie+'</td><td>'+napoveda+'</td></tr>');
});
});
}
function nastavDoplnujuce(){
$('#Pytam_Sa_Na').find('select').on('change', function() {
getRiesitelSluzba(list_komponenty,$(this).find(":selected").text(),$("#Produktova_Skupina_Sluzba").find(":selected").text(),$("#Vyber_Oblasti").find(":selected").text(),function(timV){
nastavRiesitel(timV);
});
hideDoplnujuce();
getPolia(list_komponenty,$(this).find(":selected").text(),$("#Produktova_Skupina_Sluzba").find(":selected").text(),$("#Vyber_Oblasti").find(":selected").text(),function(id,di){
console.log(id,di);
$("#"+di).parent().show();
Doplnujuce.push(di);
});
});
}
It's correct but in my list I have cascading lookup dropdown columns so you need specify column "Vyber_Oblasti" and also "Produktova_Skupina_Sluzba" after that you will see relevant data in last column "Pytam_Sa_Na"
The problem is still not solved
@RaytheonXie_MSFT if you want, I can send you full js. code
Hi @Erik Jacko ,
Do you mean we are able to change "Vyber_Oblasti" and "Produktova_Skupina_Sluzba" and the column "Pytam_Sa_Na" is unable to changed. The value of "Pytam_Sa_Na" depend on "Vyber_Oblasti" and "Produktova_Skupina_Sluzba"
Sign in to comment